Skip to content

Universamka/PCForge_test

Repository files navigation

BSA-2020

BSA-2020-QA-Tech repository

Fork repository and append your name and surname to its original name in format "-_"

Preconditions

  • Install NodeJS LTS version
  • VSCode or any other IDE
  • terminal
  • hands and brain

Useful materials for locators/selectors

Useful links

WebDriverIO - Useful to learn how it works MochaJS - Useful to learn additional commands for our test runner Chai - assertion library. Extends the NodeJS's assert.

Prerequisities

npm install

Automated tests

Run the following commands inside the folder

npm test

Structure of the project

├───output
├───lib
    ├───helpers
    ├───data
    ├───common
├───specs
    ├───component
    │   ├───pages
    │   ├───steps
    |   ├───..._test.js
    ├───...
├───types
    ├───model.d.ts
    ├───steps.d.ts
  • lib/helpers - directory with additional helpers that extends base API.
  • lib/common - directory with Page Fragments, Page Objects, Factories etc, more details here
  • specs/component - tests, located in the component folder. Each folder inside includes page objects, actions, steps and tests.
  • wdio.conf.js - base configuration for webdriverIO.

Nuances for working with helpers

  • Name of the method should be "talkable"
  • Each method should include a description (comment) about what it does and information about input and output
  • BDD concept.

If method is common it should be located in the helpers.

Nuances for working with PageObjects

  • Name of the file with PageObjects should be talkable, so it is clear what's inside. Pattern of the file name [componentName]-[componentComplexity].js
  • All the selectors/locators are stored in the PageObjects. Locator should have comment where it is situated on the page, and what it is.
  • Locator priority: Id, CSS, XPath.
  • Repeatable steps in the tests write in the PageObjects as a method.
  • Common things are stored in the steps_file.js

Nuances for writing tests

  • Name of the test should be talkable, so one can define what test about. Follow next pattern [acceptance | E2E | integration]_[test suite number]-[name]_test.js

  • Name Feature should include name of the file without _tests.js. After the name - write a description.

Example: integration_1. Description goes in here

  • Name Scenario - use case or story with acceptance criteria in the name. Follow the rule - When->Then.

Example: Unauthorised user goes to the welcome page. The user should be redirected to login page and see the login form to authorize

  • Steps of the test should be described from the end-user perspective and should be talkable.

  • All the selectors should be located inside the pageObjects

  • All the timeouts should be located inside the pageObjects

  • All tests you implement should be easy to customize.

  • WaitUntil should be used most of the time, cause sometimes chromium can move forward without loading whole page.

  • Do not refresh the page inside the tests twice;

Nuances for running tests

  • For now, all test launch can be made with npm test. In this case, no parameters can not be changed. If you need to change something, you need to edit the script in package.json. Before committing to the master, you should check that your updated settings are not included in the commit.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published