Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@pageobject/todomvc

clebert44MIT11.2.1TypeScript support: included

An exemplary test suite for the popular TodoMVC application.

readme

@pageobject/todomvc

Package Version Build Status Coverage Status TypeScript

An exemplary test suite for the popular TodoMVC application.

This package is part of PageObjectJS.

Installation

yarn add @pageobject/todomvc

Introduction

This project serves as an example implementation. We use TypeScript as programming language, Jest as test runner and perform the tests with Puppeteer in a headless Chrome. The artifact published on npm contains all components written for this project.

Test cases

You can find the complete code of all test cases here.

Creating todos

test.perform(app.page.goto('http://todomvc.com/examples/react/#/'));

test
  .assert(app.newTodoInput.hasFocus(), is(true), 'newTodoInput has focus (1)')
  .perform(app.keyboard.type('My first todo'))
  .perform(app.keyboard.press('Enter'))

  .assert(app.newTodoInput.hasFocus(), is(true), 'newTodoInput has focus (2)')
  .perform(app.keyboard.type('My second todo'))
  .perform(app.keyboard.press('Enter'))

  .assert(app.todoList.todos.first().label.getText(), is('My first todo'))
  .assert(app.todoList.todos.last().label.getText(), is('My second todo'));

Creating todos

Completing a todo

test.perform(app.page.goto('http://todomvc.com/examples/react/#/'));

test
  .assert(app.newTodoInput.hasFocus(), is(true), 'newTodoInput has focus')
  .perform(app.keyboard.type('My todo'))
  .perform(app.keyboard.press('Enter'));

const todo = app.todoList.todos.first();

test
  .assert(todo.toggle.isChecked(), is(false), 'toggle is not checked')
  .perform(todo.toggle.click())
  .assert(todo.toggle.isChecked(), is(true), 'toggle is checked');

Completing a todo

API documentation

Please find the API documentation here.


Copyright (c) 2017-present, Clemens Akens. Released under the terms of the MIT License.

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

11.2.1 (2018-04-25)

Note: Version bump only for package @pageobject/todomvc

11.2.0 (2018-04-24)

Features

  • base: add custom message argument to assert method (#225) (9cb36fb)
  • todomvc: move pageobject-puppeteer to dev dependencies (#226) (babbd15)

11.1.1 (2018-04-23)

Note: Version bump only for package @pageobject/todomvc

11.1.0 (2018-04-23)

Features

  • todomvc: add todomvc example project (#214) (db64ad8)