Created
April 10, 2020 18:12
-
-
Save taras/93e65add50ba3a0111fcdb3c14ce0793 to your computer and use it in GitHub Desktop.
This file contains 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
{ | |
description: "Sigin in via Modal", | |
steps: [ | |
{ | |
description: "visit home", | |
action: (context) => visit('/') | |
}, | |
{ | |
description: "does sign in button exist?" | |
action: Modal.isVisible() | |
} | |
], | |
assertions: [], | |
children: [{ | |
description: "When page is initially opened", | |
steps: [], | |
assertions: [{ | |
description: "it focuses on the todo input field", | |
check() { | |
let input = document.querySelector<HTMLInputElement>("[placeholder='What needs to be done?]"); | |
if (!input) { | |
throw new Error('Cannot find TODO input element'); | |
} | |
if (document.activeElement != input) { | |
throw new Error(`Expected ${input} to have focus, but it did not. Instead, it was ${document.activeElement}`); | |
} | |
} | |
}], | |
children: [] | |
}] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment