This file contains hidden or 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
import { Selector } from 'testcafe'; | |
fixture`The Kitchen - Select` | |
.page`https://kitchen.applitools.com/ingredients/select` | |
const ingredientsSelect = Selector('#spices-select-single'); | |
const ingredientsOption = ingredientsSelect.find('option'); | |
test('TestCafe', async t => { | |
await t |
This file contains hidden or 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
const { Builder, By } = require('selenium-webdriver'); | |
const chrome = require('selenium-webdriver/chrome'); | |
const assert = require('assert'); | |
describe('DemoApp - ClassicRunner', function () { | |
it('Smoke Test', async () => { | |
const driver = await new Builder() | |
.forBrowser('chrome') | |
.setChromeOptions(new chrome.Options()) | |
.build(); |
This file contains hidden or 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
const puppeteer = require('puppeteer') | |
describe('Puppeteer + Jest', () => { | |
test('should select an ingredient from the list', async () => { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
await page.goto('https://kitchen.applitools.com/ingredients/select'); | |
await page.select('#spices-select-single', 'garlic'); |
This file contains hidden or 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
const { chromium } = require('playwright') | |
describe('Playwright + Jest', () => { | |
test('should select an ingredient from the list', async () => { | |
const browser = await chromium.launch(); | |
const page = await browser.newPage(); | |
await page.goto('https://kitchen.applitools.com/ingredients/select'); | |
await page.selectOption('#spices-select-single', 'garlic'); |
This file contains hidden or 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('Cypress', () => { | |
it('should select an ingredient from the list', () => { | |
cy.visit('https://the-kitchen-applitools.netlify.app/ingredients/select') | |
cy.get('#spices-select-single').select('garlic').should('have.value', 'garlic') | |
}); | |
}); |
This file contains hidden or 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
describe('Protractor', function() { | |
it('should select an ingredient from the list', function() { | |
browser.waitForAngularEnabled(false); | |
browser.get('https://kitchen.applitools.com/ingredients/select'); | |
element(by.id('spices-select-single')).click(); | |
element(by.css("#spices-select-single [value='garlic']")).click(); | |
expect(element(by.id('spices-select-single')).getAttribute('value')).toEqual('garlic'); | |
}); |
This file contains hidden or 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
alert('This is an alert!'); |
This file contains hidden or 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
cy.window().then(win => { | |
cy.stub(win, 'prompt').callsFake(() => null); |
This file contains hidden or 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
it('should trigger a prompt with a message', () => { | |
cy.window().then(win => { | |
cy.stub(win, 'prompt').returns('This is my answer.'); | |
cy.get('#prompt-button').click(); | |
cy.get('#prompt-answer').contains('Answer: This is my answer.'); | |
}); | |
}); |
This file contains hidden or 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
cy.on('window:confirm', (text) => { | |
expect(text).to.contains('Would you like to confirm?'); | |
return false; | |
}); |