permalink | title | layout | sidebar |
---|---|---|---|
quickstart |
Quickstart |
Section |
true |
::: slot sidebar
This gives you access to rich Selenium ecosystem and cross-browser support for majority of browsers and devices.WebDriver support is implemented via webdriverio library
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.
:::
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
- Install CodeceptJS with Puppeteer
npm install codeceptjs puppeteer --save-dev
- Initialize CodeceptJS in current directory by running:
npx codeceptjs init
(use node node_modules/.bin/codeceptjs
if you have issues with npx)
- 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
- Create First Test.
npx codeceptjs gt
- Enter a test name. Open a generated file in your favorite JavaScript editor.
Feature('My First Test');
Scenario('test something', (I) => {
});
- Write a simple scenario
Feature('My First Test');
Scenario('test something', (I) => {
I.amOnPage('https://github.com/');
I.see('GitHub');
});
- 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