Skip to content

Instantly share code, notes, and snippets.

@taras
Created April 10, 2020 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taras/93e65add50ba3a0111fcdb3c14ce0793 to your computer and use it in GitHub Desktop.
Save taras/93e65add50ba3a0111fcdb3c14ce0793 to your computer and use it in GitHub Desktop.
{
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