-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dataview search e2e Tests #1468
Open
felabel
wants to merge
7
commits into
ushahidi:development
Choose a base branch
from
felabel:dataview-search-e2e
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c311c41
created automated tests for posts search in data-view
felabel 5b2a980
created automated tests for posts search in data-view
felabel 54ea635
updated naming convention for data-qa
felabel 82fb746
reverted the changes in the env files
felabel 3425eea
updated check conditions
felabel d92f886
randomly generated special charcters
felabel f398b90
added the post creation step to the daview search test
felabel 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
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
|
@@ -13,4 +13,4 @@ | |
"sentry_dsn": "", | ||
"sentry_environment": "", | ||
"sentry_debug_mode": false | ||
} | ||
} |
This file contains 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 |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
"ush_user_email": "[email protected]", | ||
"ush_user_pwd": "1234567", | ||
"ush_user_name": "Automation User Member Role" | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
e2e-testing/cypress/e2e/12-data-view/data-view-search.cy.js
This file contains 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,34 @@ | ||
import DataViewFunctions from '../../functions/DataViewFunctions/DataViewFunctions'; | ||
import LoginFunctions from '../../functions/LoginFunctions'; | ||
|
||
const dataViewFunctions = new DataViewFunctions(); | ||
import PostFunctions from '../../functions/PostsFunctions/PostFunctions'; | ||
|
||
describe('Search and Verify Posts', () => { | ||
const loginFunctions = new LoginFunctions(); | ||
const postFunctions = new PostFunctions(); | ||
|
||
beforeEach(() => { | ||
loginFunctions.login_as_admin(); | ||
cy.visit(Cypress.env('baseUrl')); | ||
}); | ||
|
||
it('should display posts with the keyword in title or description', () => { | ||
const searchKeyword = 'election'; | ||
dataViewFunctions.search_and_verify_results(searchKeyword); | ||
}); | ||
|
||
it('should display an empty state when searching with special characters', () => { | ||
const generateSpecialCharacterKeyword = () => { | ||
const specialChars = '!@#$%^&*()_+-=[]{};\':"\\|,.<>/?`~'; | ||
let keyword = ''; | ||
const length = Math.floor(Math.random() * 10) + 1; | ||
for (let i = 0; i < length; i++) { | ||
keyword += specialChars[Math.floor(Math.random() * specialChars.length)]; | ||
} | ||
return keyword; | ||
}; | ||
const specialCharKeyword = generateSpecialCharacterKeyword(); | ||
dataViewFunctions.search_and_verify_results_with_special_characters(specialCharKeyword); | ||
}); | ||
}); |
69 changes: 54 additions & 15 deletions
69
e2e-testing/cypress/functions/DataViewFunctions/DataViewFunctions.js
This file contains 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 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 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
Oops, something went wrong.
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.
Before searching for the keyword, could you add a post with the keyword so that the post exists that you are searching for.
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.
do you mean to create a new post in the test block? because there are posts with the election keyword before now...
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.
An update has been made for this, kindly review @shakirandagire