Skip to content

Instantly share code, notes, and snippets.

Avatar
🏖️
Just living the good life

Nikolay Advolodkin nadvolod

🏖️
Just living the good life
View GitHub Profile
@nadvolod
nadvolod / cypress.config.ts
Last active Sep 15, 2022
Failing cy.open() command
View cypress.config.ts
const { defineConfig } = require("cypress");
export default defineConfig({
e2e: {
// this URL keeps automatically failing the test
baseUrl: "https://who--spmstage.sandbox.lightning.force.com/lightning/page/home",
failOnStatusCode: false,
setupNodeEvents(on, config) {
// implement node event listeners here
},
View DataDrivenTest.java
@RunWith(Parameterized.class)
public class DesktopTests extends SauceBaseTest {
/*
* Configure our data driven parameters
* */
@Parameterized.Parameter
public Browser browserName;
@Parameterized.Parameter(1)
public String browserVersion;
@Parameterized.Parameter(2)
View DataDrivenTest.cs
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()
View example.Jenkinsfile
// 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
View login.java
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
@nadvolod
nadvolod / azureOnSauceWithJava.yml
Created Feb 1, 2021
A working Azure Pipelines for Java, Selenium, SauceLabs
View azureOnSauceWithJava.yml
# 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:
View SimpleExample.cs
public void mainTestCode(){
//put all the logic here
}
[TestMethod]
public void test1(){
mainTestCode();
}
[TestMethod]
public void test2(){
mainTestCode();
@nadvolod
nadvolod / cypress.spec.js
Created Sep 11, 2020
Sample Cypress tests
View cypress.spec.js
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')
@nadvolod
nadvolod / OptimizedRadioButtonTest.java
Created Sep 8, 2020
An optimized radio button clicking test
View OptimizedRadioButtonTest.java
@Test
public void optimizedTest() throws AssertionError {
driver.navigate().to("https://www.techlistic.com/p/selenium-practice-form.html");
var male = driver.findElement(By.id("sex-0"));
var actions = new Actions(driver);
actions.moveToElement(male).click().perform();
assertTrue(male.isSelected());
var female = driver.findElement(By.id("sex-1"));
@nadvolod
nadvolod / BadGherkin.feature
Last active Aug 31, 2020
Bad Gherkin example
View BadGherkin.feature
Given driver webUrl + "/demo"
And input("#abr02tre", Key.CONTROL + "a")
And match temp contains "565d"
And match temp contains "5d"
When input("#rc02ert", "test")
Then text("divId45")