-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Showing
3 changed files
with
48 additions
and
35 deletions.
There are no files selected for viewing
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,31 @@ | ||
import { LoginPage } from '@support/pages/login.page' | ||
import { LoginInfo } from '..' | ||
|
||
const SortingPOM = { | ||
sortBy(order: 'az' | 'za' | 'lohi' | 'hilo') { | ||
// select the sorting order using the <select> element | ||
cy.get('select[data-test=product_sort_container]').select(order) | ||
// once the sorting changes | ||
// get the selected option text | ||
// and save it as alias "sortName" | ||
// | ||
// alternative: get the .active_option element's text | ||
// cy.get('.active_option').invoke('text').as('sortName') | ||
}, | ||
} | ||
|
||
describe('Products', { viewportHeight: 1600 }, () => { | ||
const user: LoginInfo = Cypress.env('users').standard | ||
beforeEach(() => { | ||
LoginPage.login(user.username, user.password) | ||
|
||
cy.visit('/inventory.html', { failOnStatusCode: false }) | ||
cy.location('pathname').should('equal', '/inventory.html') | ||
}) | ||
|
||
it('sorts the items and shows the sorting order', () => { | ||
SortingPOM.sortBy('lohi') | ||
// confirm the sorting name shown below the products | ||
// is the same as selected text in the alias "sortName" | ||
}) | ||
}) |
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