Skip to content

Latest commit

 

History

History
126 lines (83 loc) · 2.46 KB

quickstart.md

File metadata and controls

126 lines (83 loc) · 2.46 KB
permalink title layout sidebar
quickstart
Quickstart
Section
true

::: slot sidebar

Use WebDriver for classical Selenium setup

This gives you access to rich Selenium ecosystem and cross-browser support for majority of browsers and devices.

Start with WebDriver »

WebDriver support is implemented via webdriverio library


Use TestCafe for cross-browser testing without Selenium

TestCafe provides cross-browser support without Selenium. TestCafe tests are faster, require no extra tooling and faster than regular Selenium. However, can be less stable.

Start with TestCafe »


:::

Quickstart

Puppeteer is a great way to start if you need fast end 2 end tests in Chrome browser. No Selenium required!

If you need cross-browser support check alternative installations with WebDriver or TestCafe →

If you start with empty project initialize npm first:

npm init -y
  1. Install CodeceptJS with Puppeteer
npm install codeceptjs puppeteer --save-dev
  1. Initialize CodeceptJS in current directory by running:
npx codeceptjs init

(use node node_modules/.bin/codeceptjs if you have issues with npx)

  1. Answer questions. Agree on defaults, when asked to select helpers choose Puppeteer.
? What helpers do you want to use?
 ◯ WebDriver
 ◯ Protractor
❯◉ Puppeteer
 ◯ Appium
 ◯ Nightmare
 ◯ FileSystem
  1. Create First Test.
npx codeceptjs gt
  1. Enter a test name. Open a generated file in your favorite JavaScript editor.
Feature('My First Test');

Scenario('test something', (I) => {

});
  1. Write a simple scenario
Feature('My First Test');

Scenario('test something', (I) => {
  I.amOnPage('https://github.com/');
  I.see('GitHub');
});
  1. Run a test:
npx codeceptjs run --steps

The output should be similar to this:

My First Test --
  test something
     I am on page "https://github.com"
     I see "GitHub"
 ✓ OK

▶ Next: CodeceptJS Basics

▶ Next: CodeceptJS with Puppeteer