- [sudo] npm install -g codeceptjs
- [sudo] npm install -g webdriverio
- npm install -g webdriver-manager
- webdriver-manager update
- webdriver-manager start
- ~/CodeceptDemo $
npm testOR - ~/CodeceptDemo $
codeceptjs run --steps
- Add .skip flag to a scenario you wish to skip
- Use Scenario.skip
- For example:
Scenario.skip('Hotel Booking', (I, bookingPage) => {
I.amOnPage('http://phptravels.net/hotels');
I.seeInTitle('Hotels Listings');
I.fillField(bookingPage.fields.location, 'Rendez');
I.pressKey('Enter');
});- Add .only flag to a scenario you wish to run
- Use Scenario.only
- For example:
Scenario.only('Hotel Booking', (I, bookingPage) => {
I.amOnPage('http://phptravels.net/hotels');
I.seeInTitle('Hotels Listings');
I.fillField(bookingPage.fields.location, 'Rendez');
I.pressKey('Enter');
});- You can add a '@wip' tag to a feature you only want to run.
- For example:
'use strict';
Feature('@wip Book Hotel Accommodation');
Before((I) => {
I.loginAs('demouser');
});
Scenario('Hotel Booking', (I, bookingPage) => {
I.amOnPage('http://phptravels.net/hotels');
I.seeInTitle('Hotels Listings');
I.fillField(bookingPage.fields.location, 'Rendez');
I.pressKey('Enter');
});- Notice the '@wip' tag in the feature above
- To run this feature only from command line:
npm run test:wip
- This Codecept Demo is using the WebDriverIO Helper as defined in the Codecept.json file
- Location:
~/CodeceptDemo/codecept.json
- Can have a collection of Page Objects to include when running your acceptance suite
- See loginPage example
~/CodeceptDemo/conf/webdriverio/acceptance.conf.js
- Screenshots are stored in the output folder
- Go to Codecept.io - http://codecept.io/quickstart/#setup