Skip to content

Instantly share code, notes, and snippets.

@lydemann
Created July 3, 2019 06:14
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 lydemann/1a9bd63d1cd72100e10a4c95f70a9c30 to your computer and use it in GitHub Desktop.
Save lydemann/1a9bd63d1cd72100e10a4c95f70a9c30 to your computer and use it in GitHub Desktop.
todo.po.ts
export class TodoPage {
public static interceptTodoListRequest(todoList: any[]) {
cy.server();
cy.route('http://localhost:8080/api/todo-list', todoList);
}
public static goToPage() {
cy.visit('/');
}
public static checkForTodos(todoList: any[]) {
todoList.forEach(todo => {
cy.contains(todo.title);
cy.get('.e2e-todoitem')
.first()
.click();
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment