GithubHelp home page GithubHelp logo

luuizeduardo / wdio-automation Goto Github PK

View Code? Open in Web Editor NEW
24.0 7.0 12.0 49 KB

Functional test automation with wdio + page objects + selenium standalone + docker

JavaScript 100.00%
wdio automation pageobject closures javascript docker selenium

wdio-automation's Introduction

Functional automation with WebDriver.io

Build Status

This repository was created to functional test automation of automation practice website.

Tecnologies used:

Setting up Report Portal

ReportPortal is a service, that provides increased capabilities to speed up results analysis and reporting through the use of built-in analytic features.

Follow steps here to install the service on Docker.

Setup

The guide goes throught steps required to setup test automation project based on WebDriver.io in order to work with Report Portal or Allure Reports.

Preparing Report Portal

In order to report test execution results to Report Portal, test automation project needs to provide the following info:

  • Report Portal instance address the results will be reported to.
  • User identity the results will be uploaded by.
  • Project name.
  • Test launch properties.

Login to a service instance and perform the next steps:

  1. Go through the projects list and pick the one where test results are expected to come into. If there no such project, go to Administrate->Add project and create it.
  2. Take uuid from Profile screen. The value will be used to authorize test automation project to the service.
  3. Keep sensitive data separatedly. It is recommended to keep sensitive data in secret, so we are not going to commit any of this. Let's use dotenv to conveniently provide and access such data in the project. Install it with npm i dotenv -D and then create .env file in the project root with values for these variables:
  • RP_USERNAME: Name of the user who will be used by auto test to verify.
  • RP_PASSWORD: User password.
  • RP_USERUUID: User UUID. Refer to Preparing Report Portal for instructions how to get it.
  • RP_ENDPOINT: Address of report portal.
  • RP_PROJECT: Project that you create in step 1.
  1. Modify WDIO config to support ReportPortal. The final step we need to do is to notify WDIO that we want to use NPM modules responsible for integration with RP. Report Portal support is enabled by 2 NPM modules: wdio-reportportal-reporter and wdio-reportportal-service. Refer to the corresponding NPM repo pages for their description. To activate the modules insert the following snippet for project config file (wdio.config.js) at the beginning:
require('dotenv').config()
const reportportal = require('wdio-reportportal-reporter');
const RpService = require("wdio-reportportal-service");
const conf = JSON.parse(require('fs').readFileSync('reportportal.config.json'));
conf.reportPortalClientConfig.token = process.env.RP_USERUUID
conf.reportPortalClientConfig.endpoint = process.env.RP_ENDPOINT
conf.reportPortalClientConfig.project = process.env.RP_PROJECT
  1. Create a Selenium Grid container to run the project using multiple browsers. Run: docker-compose up -d.
  2. Install the dependencies of this project with npm install.

Allure reports (default)

The default report generator is Allure Reports. This is the reporter that you will use when the test suit is executed.

Running test suit

To run our test suit:

  • Open terminal.
  • Navigate to the path the project was cloned in.
  • Run npm test

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.