https://github.com/breeding-insight/taf

Test Automation Framework

https://github.com/breeding-insight/taf

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.3%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Test Automation Framework

Basic Info
  • Host: GitHub
  • Owner: Breeding-Insight
  • License: apache-2.0
  • Language: JavaScript
  • Default Branch: develop
  • Size: 5.88 MB
Statistics
  • Stars: 0
  • Watchers: 5
  • Forks: 0
  • Open Issues: 3
  • Releases: 0
Created over 5 years ago · Last pushed 10 months ago
Metadata Files
Readme License

README.md

TEST AUTOMATION FRAMEWORK

Breeding Insight UI Test Automation Framework

Features

  • Create tests using Gherkin syntax
  • Execute tests on Chrome and Firefox
  • Execute multiple tests at the same time
  • CI/CD integration ready

Components

Requirements

To run tests locally, you need to install the following: NodeJS Java JRE or JDK Version Control Client Visual Studio Code | Visual Studio Code Plugin | Configuration | | ------ | ------ | | Cucumber (Gherkin) Full Support | Edit settings.json file and include the following:
"cucumberautocomplete.steps":["src/step_definitions/*.js"],
"cucumberautocomplete.strictGherkinCompletion": true, | | Cuke Step Definition Generator | none | | Gherkin Table Formatter | none |

Quick Start

  1. Clone the repository. (https://github.com/Breeding-Insight/taf.git)
  2. Install dependencies required to run the tests: sh npm install
  3. Run tests sh npm run test:chrome ## Running Tests Locally Files to change:
  4. nightwatch.conf.js (change launch_url under default to your local url)
  5. workspace.code-workspace (change server to local:)

Scripts to run tests are in package.json. One can add additional scripts locally to run a subset of scenarios with a particular tag, ie running all scenarios tagged as @SmokeTests: ```sh "test:chromeSmokeTests": "mkdirp report && cucumber-js --require cucumber.conf.js --tags @SmokeTests --require src/stepdefinitions src/features --format @cucumber/pretty-formatter --format json:report/cucumberreport.json --world-parameters \"{\\"browser\\":\\"chrome\\"}\"; npm run report"

and then run it in terminal as sh npm run test:chromeSmokeTests ```

Cucumber report by default will be saved to a folder and be overwritten with subsequent runs.

NOTE: If you are not using docker you may need to modify nightwatch.conf.js to change the "launchurl" in the testsettings/docker, to your local host and port. Example: docker: { launch_url: "http://biproxy", }, TO docker: { launch_url: "http://localhost:8080", },

Database Assumptions

The implemented scenarios assume the following data is set up on BI:

Users | Name | Email | System Role | | ------ | ------ | ------ | | Christian | christian@mailinator.com | System Administrator | | Cucumber Breeder | cucumberbreeder@mailinator.com | | | Cucumber Member | cucumbermember@mailinator.com| | | TrailMix Breeder | trailmix@mailinator.com | |

Programs | Name | Species | Users (role) | | ------ | ------ | ------ | | Snacks | Grape | Cucumber Breeder (Program Administrator)
Cucumber Member (Read Only)
Christian (Program Administrator) | | Trail Mix | Grape | Cucumber Breeder (Read Only)
TrailMix Breeder (Program Administrator)
Christian (Program Administrator) |

Automated Database Setup

There is a script setup_local_db.sh that will setup your bidb and brapi-server databases assuming bi-docker-stack and taf repos are at the same level in the filesystem and default docker services/ports are used.

Gherkin Conventions

Setting Values

  • Entering a string in a text field use "sets"
    When user sets "abcdef@test.com" in email field

Interacting with controls

  • Interacting with controls, use "selects"
    When user selects "United States" in Country dropdown
    When user selects "Apple, Banana, Pear" in combo box
    When user selects "Yes" in 'Are you hungry' radio button box
    When user selects "Here" link
    When user selects "Cancel" button

Validating controls

  • Visibility of a control, use "see" and "not see"
    Then user can see "Snacks" button
    Then user can not see "Cancel" link

Running Tests With Selenium Docker and BI-Docker-Stack

TAF can launch browser on a Selenium docker container and run tests on bi-docker-stack.

Prerequisite:

  • Docker Desktop

Clone the following repositories:

  • https://github.com/Breeding-Insight/bi-docker-stack.git
  • https://github.com/Breeding-Insight/taf.git

Configuration:

  • Set API_BASE_URL environmental variable to http://biproxy
  • Set WEB_BASE_URL environmental variable to http://biproxy
  • Set JWT_DOMAIN environmental variable to biproxy
  • Set REGISTERED_DOMAIN environmental variable to biproxy

  • Update the host's host file Windows : C:\Windows\System32\drivers\etc\host Unix: /etc/hosts Add the following line "127.0.0.1 biproxy"

  • Set the browser to "docker.chrome". In package.json, set browser to "docker.chrome". e.g. "--world-parameters \"{\\"browser\\":\\"docker.chrome\\"}\""

Starting the containers

  • For running specific branch code, make sure code is checked out in bi-docker-stack sub repo and go to the bi-docker-stack folder and execute sh docker-compose -f docker-compose.yml -f docker-compose-dev.yml up -d
  • For running latest development branch, go to the bi-docker-stack folder and execute sh docker-compose -f docker-compose.yml -f docker-compose-qa.yml up -d

  • Go to TAF folder and execute sh docker-compose up -d

Owner

  • Name: Breeding Insight
  • Login: Breeding-Insight
  • Kind: organization

Combining genomics and informatics to accelerate genetic gains.

GitHub Events

Total
  • Issue comment event: 8
  • Push event: 102
  • Pull request review comment event: 15
  • Pull request review event: 38
  • Pull request event: 31
  • Create event: 19
Last Year
  • Issue comment event: 8
  • Push event: 102
  • Pull request review comment event: 15
  • Pull request review event: 38
  • Pull request event: 31
  • Create event: 19

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 0
  • Total pull requests: 13
  • Average time to close issues: N/A
  • Average time to close pull requests: 6 days
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 13
  • Average time to close issues: N/A
  • Average time to close pull requests: 6 days
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • alex-sandercock (1)
Pull Request Authors
  • cvacalares (31)
  • mlm483 (4)
  • dmeidlin (1)
  • HMS17 (1)
Top Labels
Issue Labels
Pull Request Labels