Skip to content

Instantly share code, notes, and snippets.

View nadvolod's full-sized avatar
🏖️
Just living the good life

Nikolay Advolodkin nadvolod

🏖️
Just living the good life
View GitHub Profile
test('User can create GPW record', async ({page}) => {
await dashboardPage.createNewModule(dataModule)
// What if instead of comments, our code was self readable?
// Verify that module has name: [newModule] is created
const expectedMessage = `SuccessModule "${content}" was created.Close`
expect(dashboardPage.isModuleCreated(newModule).toEqual(expectedMessage)
await dashboardPage.isModuleCreated(newModule)
// Remove the new module to avoid spam
await dashboardPage.goToHomePage()
@nadvolod
nadvolod / playwright-azure.yml
Last active September 25, 2023 02:54
Playwright test running in Azure DevOps
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: '14.x'
@nadvolod
nadvolod / happo.spec.ts
Created November 18, 2022 15:15
An example of a working Happo.io test using Playwright
// @ts-check
import { test } from '@playwright/test';
const happoPlaywright = require('happo-playwright');
test.describe('Sitefinity CMS', () => {
test.beforeEach(async ({ page }) => {
await happoPlaywright.init(page);
await page.goto('https://afro.who.int/countries');
await page.waitForLoadState('networkidle');
await page.isVisible('[alt=Countries]');
@nadvolod
nadvolod / happo.js
Created October 9, 2022 14:52
Working happo test
import { Page, test } from '@playwright/test';
const happoPlaywright = require('happo-playwright');
let page: Page;
test.beforeAll(async ({ browser }) => {
page = await browser.newPage();
await happoPlaywright.init(page);
});
@nadvolod
nadvolod / cypress.config.ts
Last active September 15, 2022 18:51
Failing cy.open() command
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
},
@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)
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()
// 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
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 February 1, 2021 22:43
A working Azure Pipelines for Java, Selenium, SauceLabs
# 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: