0.5.9 • Published 1 year ago

eol-ft-runner v0.5.9

Weekly downloads
24
License
ISC
Repository
github
Last release
1 year ago

FUNCTIONAL TEST RUNNER (eol-ft-runner)

This framework uses Selenium-webdriver, wd, Appium & CucumberJS to run UI tests written in BDD format. This project is a work in progress. As we build towards v1.0, you can checkout the "Projects" section of GitHub to keep track of our progress.

Description poster

How to install

npm install eol-ft-runner -D

Browser Support status

BrowsermacOS/LinuxWindows
Chrome
Chrome Headless
Firefox
Firefox Headless
SafariN/A
Edge
Edge Headless🛠 WIP🛠 WIP
Android Chrome
iOS SafariN/A
Internet ExplorerN/A🛠 WIP
Opera
Brave

Mobile App status

PlatformmacOS/LinuxWindows
Android App
iOS AppN/A

Note on browser drivers

Browser drivers are not bundled with this package. You will need to install the browser drivers (Chromedriver or Gecko Driver or Edge Driver) - in your project using the below command:

npm install chromedriver --save-dev

(or)

npm install geckodriver --save-dev

(or)

npm install @sitespeed.io/edgedriver --save-dev

This will allow you to control your browser driver version, based on the browser version you are testing against.

Run GUI test(s) on your local environment:

Run your test with a configuration file:

./node_modules/eol-ft-runner/bin/ft-runner --config config.json

Run your test with CLI arguments:

./node_modules/eol-ft-runner/bin/ft-runner --config config.json --browser chrome --tags @sanity --cores 2

Run headless using --headless (only supported on chrome/firefox):

./node_modules/eol-ft-runner/bin/ft-runner --config config.json --browser chrome --tags @sanity --cores 2 --headless

Run using npm scripts:

npm run test -- --config config.json --browser chrome --tags @sanity --cores 2

In your package.json, the npm script test should point to the ft-runner executable: ./node_modules/eol-ft-runner/bin/ft-runner.

browser can be 'chrome', 'firefox', 'safari', 'edge', 'android', 'ios'.

tags are cucumber tags found on the top of a scenario inside a feature file. Tags are optional, and will execute all scenarios if not provided. To run multiple tags, use --tags "@sanity @smoke @etc".

cores are the number of parallel threads of execution specified in the format "--cores 3" or "--cores 10". Cores are optional, and will run on 2 cores if not specified. For Safari & Edge browsers, cores will be defaulted to 1 due to their respective browser instance restrictions.

Configuration file attributes

Attribute nameMandatory?TypeExample
featurePathYesString"./path/to/feature/dir"
stepDefinitionPathYesString"./path/to/step_def/dir"
supportFolderPathYesString"./path/to/support/dir"
reportFolderPathYesString"./path/to/report/dir"
browserNoArray of Strings "chrome", "firefox"
tagsNoString"@sanity" "@sanity @smoke"
parallelTypeNoString"features"
rerunNoBooleantrue
remoteAppiumHubNoObject{"address": "https://www.example-cloud.com/wd/hub","port": 8081} port is optional
desiredCapabilitiesNoObjectView below sample
{
  "configurations": {
    "browser": [ "chrome" ],
    "tags": "@sanity",
    "featurePath": [ "test/features/" ],
    "stepDefinitionPath": [ "test/step_definitions/" ],
    "supportFolderPath": [ "test/support" ],
    "reportFolderPath": "test/reports",
    "rerun": true,
    "remoteAppiumHub": {
      "address": "https://www.example-cloud.com/wd/hub",
      "port": 8081
    },
    "desiredCapabilities": {
      "chrome": {
        "browserName": "chrome",
        "unhandledPromptBehavior": "accept"
      },
      "ios": {
        "browserName": "Safari",
        "platformName": "iOS",
        "platformVersion": "14.1",
        "deviceName": "iPhone 12",
        "automationName": "XCUITest",
        "startIWDP": true,
        "newCommandTimeout": 30,
        "safariAllowPopups": true
      }
    }
  }
}

Create the config.json file anywhere in your project, and provide its relative path as a command-line argument: --config <relative_path_of_config.json>. For Windows, replace all instances of forward-slashes(/) each with 2 backslashes(\).

CLI arguments

CLI argumentDescriptionExpected value typeExample
--config /path/to/config.jsonMandatory configuration file that defines the location of feature, step-definition and hook filesString--config ./config.json
--browser [browsers]Specify the browser name for the session (can be 'chrome', 'firefox', 'safari', 'edge', 'android', 'ios')String--browser chrome --browser chrome firefox (for parallel execution)
--headlessAttempt to run a headless session (applicable for Chrome, Firefox)Boolean (optional)
--tags <tags>Provide select cucumber tags to be executedStringe.g. --tags @sanity e.g. --tags "@smoke @sanity" (for multiple tags)
--parallelType featuresProvide this flag to run scenarios from a single feature within the same threadStringe.g. --parallelType features
--remoteAppiumHub <url>Provide this flag to override the appium url even if one is provided in the config fileStringe.g. --remoteAppiumHub https://appium.samplehuburl.com/
--addDesiredCaps <desiredCapObject>Add an entirely new desired capability object or add new attributes to an existing desired capability objectStringified JSONe.g. --addDesiredCap "{\"ios\":{\"secretKey\":\"shhd0ntte11any1\"}}"
--rerunRe-execute all failing tests one more timeBoolean (optional)
--cores <n>Number of threads in execution during parallel runNumber (default: 2)--cores 4
--retry <n>Cucumber-js native retry mechanism to run any failed test scenario(s)Number--retry 3
--webhookUrl <url>Slack webhook url for Slack notificationsString--webhookUrl https://webhookurl.slack.com/blah/
--ciLinkTitle <title>Set title of the Slack message forwarded using Slack webhook URLString--ciLinkTitle "Build 14"
--ciLinkUrl <url>Set hyperlink URL for the slack titleString--ciLinkUrl https://jenkins/url

Important: key-value pairs passed via CLI arguments will override the same key-value pairs provided in the configuration json file. For example, --browser chrome CLI argument will override any browser attribute setting in the configuration file.

Read more:

Sample test project

Sample node project using eol-ft-runner: https://github.com/moneesh2011/test-eol-ft-runner

0.5.9

1 year ago

0.5.8

2 years ago

0.5.4

2 years ago

0.5.6

2 years ago

0.5.5

2 years ago

0.5.7

2 years ago

0.5.3

2 years ago

0.5.2

2 years ago

0.4.8

2 years ago

0.5.0

2 years ago

0.5.1

2 years ago

0.4.7

2 years ago

0.4.6

3 years ago

0.4.5

3 years ago

0.4.4

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.11

3 years ago

0.3.10

3 years ago

0.3.9

3 years ago

0.3.8

3 years ago

0.3.7

3 years ago

0.3.6

4 years ago

0.3.5

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.20

4 years ago

0.2.19

4 years ago

0.2.18

4 years ago

0.2.17

4 years ago

0.2.16

4 years ago

0.2.15

4 years ago

0.2.14

4 years ago

0.2.13

4 years ago

0.2.12

4 years ago

0.2.11

4 years ago

0.2.10

4 years ago

0.2.9

4 years ago

0.2.8

4 years ago

0.2.7

4 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.0

4 years ago

0.1.7

4 years ago

0.1.4

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago