Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Commit

Permalink
test: fix all acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tux4 committed Jun 27, 2020
1 parent e85697b commit 3553a5c
Show file tree
Hide file tree
Showing 9 changed files with 322 additions and 654 deletions.
10 changes: 7 additions & 3 deletions parijat-frontend/nightwatch.conf.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
module.exports = {
src_folders: ['test'],
src_folders: ['test/acceptance'],
page_objects_path: './test/acceptance/pageObjects',
webdriver : {
start_process: true,
server_path: "node_modules/.bin/chromedriver",
port: 9515
},
test_settings: {
default: {
selenium_host: '127.0.0.1',
launch_url: 'http://172.17.0.1:8080',
launch_url: 'http://0.0.0.0:8080',
globals: {},
desiredCapabilities: {
browserName: 'chrome',
Expand Down
9 changes: 5 additions & 4 deletions parijat-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,17 @@
"babel-loader": "^8.1.0",
"babel-polyfill": "^6.26.0",
"babel-register": "^6.26.0",
"chromedriver": "^83.0.0",
"core-js": "3",
"cucumber": "^5.1.0",
"cucumber-pretty": "^1.5.2",
"cucumber": "^6.0.5",
"cucumber-pretty": "^6.0.0",
"eslint": "^4.5.0",
"eslint-config-synacor": "^1.1.0",
"expect": "^23.1.0",
"if-env": "^1.0.0",
"mocha": "^5.2.0",
"nightwatch": "^1.2.4",
"nightwatch-api": "^2.3.0",
"nightwatch": "^1.3.6",
"nightwatch-api": "^3.0.1",
"preact-cli": "^3.0.0-rc.7",
"preact-render-to-string": "^5.1.9",
"pushstate-server": "^3.1.0"
Expand Down
6 changes: 3 additions & 3 deletions parijat-frontend/test/acceptance/features/filter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Feature: Filter Search Results

Background:
Given the user has browsed to the homepage
And the user has entered the string "munaa madan" into the main search field
And the user has entered the string "nepaala" into the main search field
And the user has selected the transliterated text
And the user has searched for the literature

Expand All @@ -16,5 +16,5 @@ Feature: Filter Search Results
Examples:
| author_name |
| दिलिप योन्जन |
| पुरुषोत्तम सुवेदी |
| विप्लव ढकाल |
| गोपाल योञ्जन |
| निमेष निखिल |
4 changes: 2 additions & 2 deletions parijat-frontend/test/acceptance/features/search.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Feature: search
Given the user has browsed to the homepage

Scenario: user should be able to search in english characters using transliterated text
When the user enters the string "munaa madan" into the main search field
When the user enters the string "nepaala" into the main search field
And the user selects the transliterated text
And the user searches for the literature
Then the search result should be displayed
Expand All @@ -19,7 +19,7 @@ Feature: search
Then the search result should not be displayed

Scenario: user should be able to search in nepali characters
When the user enters the string "मुना मदन्" into the main search field
When the user enters the string "नेपाल" into the main search field
And the user searches for the literature
Then the search result should be displayed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Feature: transliteration
Given the user has browsed to the homepage

Scenario: nepali string transliteration for the entered english character term should be displayed
When the user enters the string "munaa madan" into the main search field
Then the transliteration should be "मुना मदन्"
When the user enters the string "nepaala" into the main search field
Then the transliteration should be "नेपाल"

Scenario: nepali string transliteration for the entered nepali character term should not be displayed
When the user enters the string "मुना मदन्" into the main search field
Then the transliteration should not be displayed
When the user enters the string "नेपाल" into the main search field
Then the transliteration should not be displayed
2 changes: 1 addition & 1 deletion parijat-frontend/test/acceptance/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { setDefaultTimeout, After, Before } = require('cucumber')
const { createSession, closeSession, startWebDriver, stopWebDriver } = require('nightwatch-api')

setDefaultTimeout(60000)
setDefaultTimeout(60000);

Before(async () => {
await startWebDriver();
Expand Down
2 changes: 1 addition & 1 deletion parijat-frontend/test/acceptance/pageObjects/homePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = {
locateStrategy: 'xpath'
},
transliterationTextField: {
selector: "//span[contains(@class,'TransliteratedList__Item')]",
selector: "//button[contains(@class,'TransliteratedInput__Suggestion')]",
locateStrategy: 'xpath'
},
searchButton: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ Then('the transliteration should not be displayed', () => client.useXpath()
Given('the user has selected the transliterated text', () => client.page.homePage().selectTheTransliteratedText());

When('the user selects the transliterated text', () => client.page.homePage().selectTheTransliteratedText());

Loading

0 comments on commit 3553a5c

Please sign in to comment.