forked from boranton/testcafe-workshop
30 lines
788 B
JavaScript
30 lines
788 B
JavaScript
import { Selector } from 'testcafe'
|
|
|
|
fixture('Test TodoMVC App')
|
|
.page('http://localhost:8080')
|
|
|
|
// hvis problemer, bruk følgende i stedet
|
|
// .page('http://todomvc.com/examples/vanillajs/')
|
|
|
|
|
|
// Test å redigere en todo ved å velge første todo
|
|
// Hint:
|
|
// - Dobbelklikk på rett element for å starte redigeringsmodus
|
|
// - pressKey kan kjøre flere tastetrykk "backspace left right"
|
|
test('Edit todo', async t => {
|
|
const firstTodoItem = Selector('.todo-list li:nth-child(1)');
|
|
const input = Selector('.new-todo');
|
|
|
|
await t
|
|
.typeText(input, 'Jeg liker mandager')
|
|
.pressKey('enter');
|
|
|
|
await t
|
|
// == Skriv actions for å endre tekst her ==
|
|
|
|
await t
|
|
.expect(firstTodoItem.textContent)
|
|
.contains('Jeg liker fredager');
|
|
})
|
|
|