0.0.80 • Published 6 years ago

tun-test-automation-core v0.0.80

Weekly downloads
81
License
ISC
Repository
-
Last release
6 years ago

Installation requirements

  1. Node.js
  2. Visual Studio Code

Installation

  1. Clone this project/repository
  2. Run npm install in the root folder

How to execute internal tests

Gherkin tests (Web UI tests) - Command Line

Run node_modules\.bin\wdio tests\gherkin\wdio.conf.js

Mocha tests (intended for REST API integration testing) - Command Line

Run node_modules\.bin\mocha tests\Mocha\features\*.js

WDIO Configuration usage

We use the WebdriverIO cucumber test runner for when executing web tests.
The wdio executable expects a wdio config file as first argument (as seen in the Gherkin test example above).

Tunstall internals

debug - set this to true in order to activate WDIO debug mode

Example usage:

const debug = process.env.DEBUG;

WDIO debug documentation:
http://webdriver.io/guide/testrunner/debugging.html
http://webdriver.io/api/utility/debug.html

defaultTimeoutInterval - the time that Selenium Webdriver will wait for an element to meet a certain state (e.g. visible, hidden)

Example usage:

const defaultTimeoutInterval = 20 * 1000;

Selector usage for WDIO web tests

All of the keyActions that are exposed for external usage require that selectors have been registered as global.selectors at startup.

A selector is simply a HTML DOM element that is part of a browser web application. These elements can be identified in many ways, e.g. by id, className, cssSelector and xpath. A selector can be a button, input field, a paragragh, anything that's part of a web page.

The main way of registering the selectors that we want to use is by creating a data folder in your root project folder, followed by a selectors folder. In this folder you may add .js files with any name and within any folder hierarchy.
The idea of having seperate files is that you should be able to separate or structure your selector content, avoiding to have everything in one file.

Lets assume you have 1 file named home-page-selectors.js which holds this json data:

[
  {
    "name" : "white submit button",
    "selector" : "#whiteButton",
    "text" : 'Submit'
  },
  {
    "name" : "username field",
    "selector" : "#username",
    "text" : null
  }
]

The files within \data\selectors aren't magically assigned to the global.selectors variable by itself. You simply need to make us of the dataSelectorParser.js to make this happen.
Example implementation from an external project:

const tunstallCore = require('tun-test-automation-core');
tunstallCore.clients.web.dataSelectorParser.loadAtStartup('/path-to-/data/selector/-folder', (done) => {
    console.log("global.selector setup done");
});

The above example implementation ensures that all json/selectors from the /data/selectors/ (and beyond) are parsed and concatenated into a single array of selectors - an array which is assigned to the global global.selectors variable.

The core keyActions take selectorName's as arguments. For instance, if we make use of the example selectors mentioned above, an implementation would look like this:

  • Clicking on an element:
    tunstallCore.clients.web.click('white submit button');

  • Writing a value in an element:
    tunstallCore.clients.web.write('my text', 'username field');

The methods take the "friendly" selector name as a parameter and map this to the actual element selector.
The click will in this case pull a selector from global.selectors that has the name white submit button and click on its selector, #whiteButton.
The write function will enter the text "my text" in the #username selector, belonging to "username field".

We make use of a "friendly name" in our selector data so that we can write gherkin tests that make sense.
A tester is able to create a test case and write Then I click on the google search button whereas the google search button is a dynamic parameter that exists as a selector in the project specific selector data (/data/selectors/).

Todo list

  • Add a test case that uses image comparision (Visual Regression service)
  • Use Selenium Grid?
  • Determine which report services to use (for Mocha and Gherkins/Cucumber)
  • Add an Android App test case (Gherkins)
  • Add an iOS App test case (Gherkins)
0.0.80

6 years ago

0.0.79

6 years ago

0.0.78

6 years ago

0.0.77

6 years ago

0.0.76

6 years ago

0.0.75

6 years ago

0.0.74

6 years ago

0.0.73

6 years ago

0.0.72

6 years ago

0.0.71

6 years ago

0.0.70

6 years ago

0.0.69

6 years ago

0.0.68

6 years ago

0.0.67

6 years ago

0.0.66

6 years ago

0.0.65

6 years ago

0.0.64

6 years ago

0.0.63

6 years ago

0.0.62

6 years ago

0.0.61

6 years ago

0.0.60

6 years ago

0.0.59

6 years ago

0.0.58

6 years ago

0.0.57

6 years ago

0.0.56

6 years ago

0.0.55

6 years ago

0.0.54

6 years ago

0.0.53

6 years ago

0.0.52

6 years ago

0.0.51

6 years ago

0.0.50

6 years ago

0.0.49

6 years ago

0.0.48

6 years ago

0.0.47

6 years ago

0.0.46

6 years ago

0.0.45

6 years ago

0.0.44

6 years ago

0.0.43

6 years ago

0.0.42

6 years ago

0.0.41

6 years ago

0.0.40

6 years ago

0.0.39

6 years ago

0.0.38

6 years ago

0.0.37

6 years ago

0.0.36

6 years ago

0.0.35

6 years ago

0.0.34

6 years ago

0.0.33

6 years ago

0.0.32

6 years ago

0.0.31

6 years ago

0.0.30

6 years ago

0.0.29

6 years ago

0.0.28

6 years ago

0.0.27

6 years ago

0.0.26

6 years ago

0.0.25

6 years ago

0.0.24

6 years ago

0.0.23

6 years ago

0.0.22

6 years ago

0.0.21

6 years ago

0.0.20

6 years ago

0.0.19

6 years ago

0.0.18

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago