-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b01ae51
commit 391227c
Showing
8 changed files
with
75 additions
and
18 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
import { Faker, Randomizer } from '@faker-js/faker'; | ||
import loginData from '../fixtures/login.json' | ||
import staticDropdowns from '../support/utils/static-dropdowns'; | ||
|
||
|
||
describe('Login Functionality', () => { | ||
beforeEach(() => { | ||
Cypress.on("uncaught:exception", () => { | ||
return false; | ||
}) | ||
cy.login(loginData.user.userName, loginData.user.password) | ||
}) | ||
|
||
|
||
context('User register', () => { | ||
it('Should register an new user sucessfully', () => { | ||
cy.goToPage('admin/viewSystemUsers', 'System Users') | ||
cy.get('button.oxd-button').contains('Add').click() | ||
staticDropdowns.selectDropdownsElement('div.oxd-select-text-input', '0') | ||
staticDropdowns.selectDropdownsElement('div.oxd-select-text-input', '1') | ||
}) | ||
}) | ||
|
||
}) |
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 was deleted.
Oops, something went wrong.
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,23 @@ | ||
class DynamicDropdown { | ||
selectOptionDropdownElements(selector, option) { | ||
cy.intercept('GET', '**/pim/**').as('autocomplete'); | ||
cy.get(selector, { timeout: timeout }) | ||
.clear({ force: true }) | ||
.click() | ||
.wait('@autocomplete') | ||
.get('li[role="option"]', { timeout: timeout }).then(($ele) => { | ||
const elementFound = Array.from($ele).some(($el) => { | ||
if ($el.textContent.includes(option)) { | ||
cy.wrap($el).click(); | ||
return true | ||
} | ||
return false | ||
}) | ||
if (!elementFound) { | ||
throw new Error(`The text "${option}" was not found in list`) | ||
} | ||
}) | ||
} | ||
} | ||
|
||
export default new DynamicDropdown() |
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,14 @@ | ||
class StaticDropdown { | ||
|
||
selectDropdownsElement(selector, index) { | ||
if (index) { | ||
cy.get(selector, { timeout: 6000 }).eq(index).click() | ||
} else { | ||
cy.get(selector, { timeout: 6000 }).click() | ||
} | ||
|
||
} | ||
|
||
} | ||
|
||
export default new StaticDropdown() |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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