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
@Test | |
public void addUser_checkReturnedData_shouldCorrespondToDataSent() { | |
GraphQLQuery query = new GraphQLQuery(); | |
query.setQuery("mutation insert_users ($id: uuid!, $name: String!, $rocket: String!) { insert_users(objects: {id: $id, name: $name, rocket: $rocket}) { returning { id name rocket } } }"); | |
User myUser = new User( | |
UUID.randomUUID(), | |
"Bas", | |
"My awesome rocket" |
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 an alert with a message', () => { | |
cy.get('#alert-button').click(); | |
cy.on('window:alert', (text) => { | |
expect(text).to.contains('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
it('should trigger a confirmation with a message', () => { | |
cy.get('#confirm-button').click(); | |
cy.on('window:confirm', (text) => { | |
expect(text).to.contains('Would you like to confirm?'); | |
}); | |
cy.get('#confirm-answer').contains('Answer: Yes'); | |
}); |
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; | |
}); |
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.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
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
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
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
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'); |