influxdb/e2e
karel-rehor 98549869d2 tests: add click through test for history
applied patch from https://github.com/bonitoo-io/selenium-accept-infl2/pull/56
2020-05-14 11:28:23 -06:00
..
.circleci chore: import e2e tests 2020-05-13 14:55:16 -06:00
etc/test-data chore: import e2e tests 2020-05-13 14:55:16 -06:00
features tests: add click through test for history 2020-05-14 11:28:23 -06:00
scripts Cleanup the comments, according to the feedbacks 2020-05-13 16:39:45 -06:00
src tests: add click through test for history 2020-05-14 11:28:23 -06:00
.babelrc chore: import e2e tests 2020-05-13 14:55:16 -06:00
.eslintrc.json chore: import e2e tests 2020-05-13 14:55:16 -06:00
Makefile chore: import e2e tests 2020-05-13 14:55:16 -06:00
README.md chore: import e2e tests 2020-05-13 14:55:16 -06:00
cucumber.js chore: import e2e tests 2020-05-13 14:55:16 -06:00
e2e.conf.json chore: import e2e tests 2020-05-13 14:55:16 -06:00
hooks.js chore: import e2e tests 2020-05-13 14:55:16 -06:00
package.json chore: import e2e tests 2020-05-13 14:55:16 -06:00

README.md

Selenium-Accept

Selenium Acceptance tests for the Influxdbv2 UI.

Run cycle

npm install
npm run influx:setup
npm test
node src/utils/htmlReport.js
node src/utils/junitReport.js

Note that the final two reporting steps can be bundled into package.json scripts, or can be called as a part of the package.json test script. They are shown here to show how third party components are used to generate reports.

Tips

Run only the feature under development

npm test -- features/onboarding/onboarding.feature:4

Number is line number where the target scenario starts.

API Notes

Steps classes should directly or indirectly inherit from the baseSteps class in baseSteps.js. This class contains some generic methods to streamline Selenium and Cucumber interactions. More will be added as the test suite grows. Here is a list as of 1.10.2019.

assertNotPresent(selector)

assertNotVisible(element)

assertVisible(element)

clearInputText(input)

clickAndWait(element, wait = async () => { await this.driver.sleep((await this.driver.manage().getTimeouts()).implicit/20); })

clickPopupWizardContinue()

clickPopupWizardPrevious()

clickPopupWizardFinish()

clickPopupCancelBtn()

closeAllNotifications()

containsNotificationText(text)

containsErrorNotification(text)

delay(timeout)

dismissPopup()

hoverOver(element)

typeTextAndWait(input, text, wait = async () => { await this.driver.sleep((await this.driver.manage().getTimeouts()).implicit/20); })

verifyElementContainsText(element, text)

verifyElementContainsClass(element, clazz)

verifyElementDoesNotContainClass(element, clazz)

verifyElementDisabled(element)

verifyElementErrorMessage(msg, equal = true)

verifyElementText(element, text)

verifyInputErrorIcon()

verifyInputEqualsValue(input, value)

verifyInputContainsValue(input, value)

verifyInputDoesNotContainValue(input, value)

verifyNoElementErrorMessage()

verifyNoFormInputErrorIcon()

verifyPopupAlertContainsText(text)

verifyPopupAlertMatchesRegex(regex)

verifyPopupNotPresent()

verifyWizardContinueButtonDisabled()

verifyWizardDocsLinkURL(url)

Pages should inherit directly or indirectly from the basePage class in basePage.js. This contains many common selectors and element getters found either in the over all framework or in common components such as wizards and popups.

The file commonStepDefs.js contains a library of test statements leveraging baseSteps and covering functionality that will often need to be repeated. It also contains steps for accessing methods from influxUtils.js for accessing the REST api through AXIOS, which is useful for setting up test data for a feature set.