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
debugger; | |
await t | |
.click('#populate') | |
.click('#submit-button'); |
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
await t | |
.click('#populate') | |
.debug() | |
.click('#submit-button'); |
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
await t | |
.setNativeDialogHandler(() => true) | |
.takeScreenshot(‘./screenshots’) | |
.click('#populate') | |
.takeScreenshot(‘./screenshots’) | |
.click('#submit-button'); |
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
.selector-icon { | |
width: 30px; | |
height: 30px; | |
min-width: 30px; | |
min-height: 30px; | |
&.html { | |
background: url(./images/sprite.png) -156px -76px no-repeat; | |
} |
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, ClientFunction } from 'testcafe'; | |
fixture `Let\'s take a look at the new TestCafe` | |
.page `url of delivery service here (hidden not to be an ad)`; | |
test(`Get a pizza`, async t => { | |
await t | |
.click(Selector('#menu-primary-menu').find('li').nth(2)) | |
.switchToIframe('iframe'); |
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, ClientFunction } from 'testcafe'; | |
fixture `Let\'s take a look at the new TestCafe` | |
.page `url of delivery service here (hidden not to be an ad)`; | |
class PizzaForm { | |
constructor (pizzaTitle, size) { | |
this.form = Selector('form').withAttribute('data-item-name', pizzaTitle); | |
this.sizeSelect = this.form.find('select[name="size"]'); | |
this.sizeOption = this.sizeSelect.find('option').withText(size); |
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
fixture `Let\'s take a look at the new TestCafe` | |
.page `url of delivery service here (hidden not to be an ad)`; | |
test(`Get a pizza`, async t => { | |
// TODO: test | |
}); |
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(`Get a pizza`, async t => { | |
await t.click(Selector('#menu-primary-menu').find('li').nth(2)); | |
}); |
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
await t.switchToIframe('iframe'); | |
const deferredOrderingButton = await Selector('#submit_ordering'); | |
if (deferredOrderingButton.exists) | |
await t.click(deferredOrderingButton); | |
let pizzaForm = Selector('form').withAttribute('data-item-name', 'White Primavera'); | |
const sizeSelect = pizzaForm.find('select[name="size"]'); |
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 order = Selector('#order'); | |
const orderItem = order.find('.order_item'); | |
const orderItemTitle = order.find('.order_item > h3'); | |
const orderItemDetail = order.find('.order_item > .item-detail'); | |
const totalPriceElemnt = order.withText('Subtotal').find('strong'); | |
await t | |
.expect(orderItem.count).eql(1) | |
.expect(orderItemTitle.textContent).contains('White Primavera') | |
.expect(orderItemDetail.textContent).contains('Large') |
OlderNewer