This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Core.BestPractices.Web.Tests.Desktop | |
{ | |
// We read data from TestConfigData.PopularDesktopCombinations | |
[TestFixtureSource(typeof(TestConfigData), nameof(TestConfigData.PopularDesktopCombinations))] | |
[TestFixture] | |
[Parallelizable] | |
public class DesktopTests : WebTestsBase | |
{ | |
[SetUp] | |
public void SetupDesktopTests() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://sealights.atlassian.net/wiki/spaces/SUP/pages/752648435/Using+Sealights+from+a+Jenkins+Pipeline+job | |
// working version | |
pipeline { | |
// agent instructs Jenkins to allocate an executor | |
agent any | |
tools { | |
// Install maven | |
maven "maven3.6" | |
} | |
// bulk of work is located here like Build, Test, and Deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void loginSuccessfully() { | |
//something like this, needs more work | |
app().visit(); | |
app().login() | |
assertTrue(app().isUserLoggedIn()); | |
} | |
public class App(){ | |
public void visit(){ | |
//can visit with a page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using OpenQA.Selenium; | |
using OpenQA.Selenium.Firefox; | |
using OpenQA.Selenium.Support.UI; | |
namespace SeleniumWebdriverTips | |
{ | |
[TestClass] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ProductsPage : BasePage | |
{ | |
private readonly string _pageUrlPart; | |
public ProductsPage(IWebDriver driver) : base(driver) | |
{ | |
_pageUrlPart = "inventory.html"; | |
} | |
// An element can be located using ExpectedConditions through an explicit wait |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
element = driver.FindElement(By.LinkText("Click me using this link text!")); | |
//this will scroll the element and center it for interaction | |
var js = (IJavaScriptExecutor)Driver; | |
js.ExecuteScript("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center'})", element); | |
//this one will scroll the element into view for interactions | |
IJavaScriptExecutor je = (IJavaScriptExecutor)driver; | |
je.ExecuteScript("arguments[0].scrollIntoView(false);", element); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maven | |
# Build your Java project and run tests with Apache Maven. | |
# Add steps that analyze code, save build artifacts, deploy, and more: | |
# https://docs.microsoft.com/azure/devops/pipelines/languages/java | |
trigger: | |
- main | |
pr: | |
- main | |
pool: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void mainTestCode(){ | |
//put all the logic here | |
} | |
[TestMethod] | |
public void test1(){ | |
mainTestCode(); | |
} | |
[TestMethod] | |
public void test2(){ | |
mainTestCode(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pool: | |
name: Hosted VS2017 | |
demands: | |
- msbuild | |
- visualstudio | |
- vstest | |
steps: | |
- script: set | |
displayName: print all variables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context('Login page', ()=>{ | |
beforeEach(()=> { | |
cy.visit('https://www.saucedemo.com/') | |
}) | |
it('can open page', () => { | |
cy.title().should('eq', 'Swag Labs') | |
}) | |
it('can login', () => { | |
cy.get('#user-name').type('standard_user') |