This repository was archived by the owner on Jun 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 370
functional tests #401
Merged
Merged
functional tests #401
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2652302
:triangular_ruler: functional tests
thabti 6f1fd91
[test] local and ci functions
thabti 12e97c9
e-2-e js functional tests
thabti 6bf3b17
remove wait
thabti 8a1f2d1
merge upstream
thabti 6c9ff34
little clean up
thabti 38e9a8f
remove spacing
thabti 10708fe
removing empty lines and refactoring
thabti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
remove wait
- Loading branch information
commit 6bf3b1755f4ec0d1f95256cd41daf5a1af5a0a15
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,15 @@ | ||
| module.exports = class BasePage { | ||
|
|
||
|
||
| constructor() { | ||
| constructor(selectors) { | ||
|
|
||
| this.selectors = { | ||
| SURAH_NAME: '.surah-body .navbar-text.surah-name' | ||
| }; | ||
| } | ||
|
|
||
| wait(time = 200) { | ||
| this.selectors = Object.assign(selectors, { | ||
| SURAH_PAGE_SURAH_NAME: '.surah-body .navbar-text.surah-name' | ||
| }); | ||
|
|
||
|
||
| browser.pause(time); | ||
| } | ||
|
|
||
| getSurahName() { | ||
| return browser.getText(this.selectors.SURAH_NAME); | ||
| return browser.getText(this.selectors.SURAH_PAGE_SURAH_NAME); | ||
| } | ||
|
|
||
| goHome() { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,12 @@ | ||
| import BasePage from './BasePage'; | ||
| import selectors from './selectors'; | ||
|
|
||
| export default class HomePage extends BasePage { | ||
|
|
||
| constructor(browser) { | ||
|
|
||
|
||
| const selectors = { | ||
| LANDING_TEXT: 'h4.title', | ||
| NEXT: 'a[data-direction="next"]', | ||
| PREVIOUS: 'a[data-direction="previous"]', | ||
| SURAH_LIST: '.row .col-md-4 li', | ||
| SEARCH_FORM: '.searchinput input', | ||
| SEARCH_RESULT_LIST: '.searchinput a', | ||
| SURAH_NAME: '.navbar-text.surah-name' | ||
| }; | ||
|
|
||
| super(browser, selectors); | ||
| super(selectors); | ||
|
|
||
| this.browser = browser; | ||
| this.selectors = selectors; | ||
| } | ||
|
|
@@ -33,7 +26,7 @@ export default class HomePage extends BasePage { | |
| searchForSurahAndGoToSurahPage(searchQuery) { | ||
|
|
||
| browser.setValue(this.selectors.SEARCH_FORM, searchQuery); | ||
| this.wait(1000); | ||
| browser.waitForVisible(this.selectors.SEARCH_RESULT_LIST); | ||
| browser.click(this.selectors.SEARCH_RESULT_LIST); | ||
| return this.getSurahName(); | ||
|
|
||
|
|
@@ -43,7 +36,6 @@ export default class HomePage extends BasePage { | |
| const surahs = browser.elements('.row .col-xs-7 span'); | ||
| const surahID = surahs.value[number].ELEMENT; | ||
| browser.elementIdClick(surahID); | ||
| this.wait(1000); | ||
| return browser.getUrl(); | ||
|
|
||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| module.exports = { | ||
| LANDING_TEXT: 'h4.title', | ||
| NEXT: 'a[data-direction="next"]', | ||
| PREVIOUS: 'a[data-direction="previous"]', | ||
| SURAH_LIST: '.row .col-md-4 li', | ||
| SEARCH_FORM: '.searchinput input', | ||
| SEARCH_RESULT_LIST: '.searchinput a', | ||
| SURAH_PAGE: '.surah-body .surah-title', | ||
| SURAH_NAME: '.navbar-text.surah-name' | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not
export default?