working on it ...

Filters

snippets
3
followers
14
Published by lbottaro

Web Automation Test

Here some tips&code about how to automate the web testing process, avoid boring and repetitive stuff and focusing on how to improve the regression tests...
Sort by

Found 3 snippets

    public by cghersi  22007  168  9  4

    How to run unit tests created with MS Visual Studio without installing Visual Studio

    Do you want to run your unit tests on your staging server? Surely you don't want to make your staging environment "dirty" by installing Visual Studio. I'm also not comfortable with installing the Test Agent. And perhaps you don't have the resources to use Visual Studio Online Continuous Integration stuff... It's not a problem of licenses. We don
    1) From C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow (copy all content of the folder):
    Extensions (folder)
    ActivateApplication.exe
    EntityFramework.dll
    extension.vsixmanifest
    Microsoft.TeamFoundation.TestPlatform.Client.dll
    Microsoft.TestTools.Cpp.targets
    Microsoft.VisualStudio.MSTest.TestWindow.dll
    Microsoft.VisualStudio.TestPlatform.BuildTasks.dll
    Microsoft.VisualStudio.TestPlatform.Client.dll
    Microsoft.VisualStudio.TestPlatform.Common.dll
    Microsoft.VisualStudio.TestPlatform.Core.dll
    Microsoft.VisualStudio.TestPlatform.Fakes.dll
    Microsoft.VisualStudio.TestPlatform.ObjectModel.dll
    Microsoft.VisualStudio.TestPlatform.TestExecutor.Core.dll
    Microsoft.VisualStudio.TestPlatform.Utilities.AppContainer.dll
    Microsoft.VisualStudio.TestPlatform.Utilities.dll
    Microsoft.VisualStudio.TestPlatform.Utilities.PhoneAppContainer.dll
    Microsoft.VisualStudio.TestWindow.Core.dll
    Microsoft.VisualStudio.TestWindow.CppUnitTestExtension.dll
    Microsoft.VisualStudio.TestWindow.dll
    Microsoft.VisualStudio.TestWindow.Interfaces.dll
    Microsoft.VisualStudio.TestWindow.pkgdef
    Microsoft.VisualStudio.TestWindow.VSTest.dll
    msdia120typelib_clr0200.dll
    TestWindowProvideCodeBase.pkgdef
    vstest.console.exe
    vstest.console.exe.config
    vstest.discoveryengine.exe
    vstest.discoveryengine.exe.config
    vstest.discoveryengine.x86.exe
    vstest.discoveryengine.x86.exe.config
    vstest.executionengine.clr20.exe
    vstest.executionengine.clr20.exe.config
    vstest.executionengine.exe
    vstest.executionengine.exe.config
    vstest.executionengine.x86.clr20.exe
    vstest.executionengine.x86.clr20.exe.config
    vstest.executionengine.x86.exe
    vstest.executionengine.x86.exe.config
    
    2) From C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC:
    vcvarsall.bat (put this file into a sufolder named "vc")
    
    3) From C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies:
    Microsoft.VisualStudio.QualityTools.Sqm.dll
    
    4) From C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ReferenceAssemblies\v2.0:
    Microsoft.VisualStudio.QualityTools.ExecutionCommon.dll
    
    5) For these files you need to use copy command from a DOS prompt, and then copy from c:/tmp to your staging folder: 
    copy C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.QualityTools.Resource\12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.QualityTools.Resource.dll c:\tmp
    copy C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.QualityTools.Common\12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.QualityTools.Common.dll c:\tmp
    copy C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel\12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel.dll c:\tmp
    copy C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.QualityTools.UnitTestFramework\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll c:\tmp
    

    public by lbottaro  11094  5  10  4

    Dalekjs - Simple automated web test

    This snippet is a simple test for web page using Dalekjs testing tool. Here I import functions from a 'functions' file (placed in the same dir of this file, called functions.js). The test will execute three tests, 'Snip2code footer', 'LogOut' and 'Sign Up'. More info about dalekjs tool here Site: dalekjs.com
    //var S2CSettings = require('s2c_settings');
    var S2Cfns = require('./s2c_functions');
    var domain = "http://www.snip2code.com/"
    var appName = "Snip2Code"
    
    module.exports = {
    'Snip2code footer': function (test) {
      test
    	.open(domain)
    	.assert.url(domain, 'URL is as expected')
        .assert.title().is('Snip2Code', 'It has title')
    	.assert.exists('a[href="/Static/ToS"]', 'ToS exists')
    	.assert.exists('a[href="/Static/Privacy"]', 'Privacy exists')
    	.assert.exists('a[href="/Static/AboutUs"]', 'AboutUs exists')
    	.assert.exists('a[href="mailto:info@snip2code.com"]', 'Mailto exists')
    	.assert.exists('a[href="/Static/Downloads"]', 'Downloads exists')
    	.assert.exists('a[href="http://blog.snip2code.com"]', 'Blog exists')
    	.assert.exists('a[href="/Static/Docs"]', 'API exists')
        .done();
    },
    'Logout': S2Cfns.S2CLogout.bind(S2Cfns, domain),
    'Sign Up': function (test) {
      test
    	.open(domain)
    	.click('#signupBigBt')
    	.assert.title().is('Snip2Code - Sign Up', 'Sign Up is loaded')
    	.assert.url().to.contain(domain + 'Access/Signup', 'URL is as expected')
    	.type('#EMail', 'email@test.com')
    	.type('#Username', 'Pinkman')
    	.type('#Password', 'Walt')
    	.wait(5000)
        .done();
    }
    };  

    public by lbottaro  3624  1  8  3

    Dalekjs - Define a simple functions file

    This file contains a sample of utility functions you can import in your web automation test file, using dalekjs testing tool. You can specify the argument to pass to the method: here the 'domain' argument is used into the method. More info about dalekjs tool here Site: dalekjs.com
    module.exports = {
    S2CLogout: function (domain, test) {
      console.log('Domain is:', domain);
      test
        .open(domain+'/Access/Logout')
        .done();
    }
    };

    List Complete ( 3 snippets total )

    • Public Snippets
    • Channels Snippets