-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test related table general features + share & cite popup + indv relat…
…ed presentation
- Loading branch information
Showing
13 changed files
with
513 additions
and
63 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
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 |
---|---|---|
@@ -1,11 +1,76 @@ | ||
import { Locator, Page } from '@playwright/test'; | ||
|
||
export default class ModalLocators { | ||
static getProfileModal(page: Page) : Locator { | ||
|
||
// ------------ modal container getters ------------ // | ||
|
||
static getProfileModal(page: Page): Locator { | ||
return page.locator('.profile-popup'); | ||
} | ||
|
||
static getCloseBtn (modal: Locator) : Locator { | ||
static getShareCiteModal(page: Page): Locator { | ||
return page.locator('.chaise-share-citation-modal'); | ||
} | ||
|
||
// ------------- common modal functions -------------- // | ||
|
||
static getModalTitle(modal: Locator) { | ||
return modal.locator('.modal-title'); | ||
} | ||
|
||
static getModalText(modal: Locator) { | ||
return modal.locator('.modal-body'); | ||
} | ||
|
||
static getCloseBtn(modal: Locator): Locator { | ||
return modal.locator('.modal-close'); | ||
} | ||
|
||
|
||
// --------- share cite related functions ------------ // | ||
|
||
static async waitForCitation(modal: Locator, timeout?: number): Promise<void> { | ||
await modal.locator('.citation-loader').waitFor({ state: 'detached', timeout }); | ||
} | ||
|
||
static getVersionedLinkElement(modal: Locator): Locator { | ||
return modal.locator('.share-modal-versioned-link'); | ||
} | ||
|
||
static getLiveLinkElement(modal: Locator): Locator { | ||
return modal.locator('.share-modal-live-link'); | ||
} | ||
|
||
static getModalListElements(modal: Locator): Locator { | ||
return ModalLocators.getModalText(modal).locator('li'); | ||
} | ||
|
||
static getShareLinkHeader(modal: Locator): Locator { | ||
return modal.locator('.share-modal-links h2'); | ||
} | ||
|
||
static getShareLinkSubHeaders(modal: Locator): Locator { | ||
return modal.locator('.share-modal-links h3'); | ||
} | ||
|
||
static getShareLinkCopyBtns(modal: Locator): Locator { | ||
return modal.locator('.share-modal-links .chaise-copy-to-clipboard-btn') | ||
} | ||
|
||
static getCitationHeader(modal: Locator): Locator { | ||
return modal.locator('.share-modal-citation h2'); | ||
} | ||
|
||
static getDownloadCitationHeader(modal: Locator): Locator { | ||
return modal.locator('.share-modal-download-citation h3'); | ||
} | ||
|
||
static getCitationText(modal: Locator): Locator { | ||
return modal.locator('.share-modal-citation-text'); | ||
} | ||
|
||
static getBibtex(modal: Locator): Locator { | ||
return modal.locator('.bibtex-download-btn'); | ||
} | ||
|
||
} |
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
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 |
---|---|---|
@@ -1,16 +1,26 @@ | ||
import { Locator, Page } from '@playwright/test'; | ||
|
||
export default class RecordsetLocators { | ||
static async waitForRecordsetPageReady(page: Page) { | ||
await RecordsetLocators.getRecordSetTable(page).waitFor({ state: 'visible' }); | ||
static async waitForRecordsetPageReady(page: Page, timeout?: number): Promise<void> { | ||
await RecordsetLocators.getRecordSetTable(page).waitFor({ state: 'visible', timeout }); | ||
|
||
await page.locator('.recordest-main-spinner').waitFor({ state: 'detached', timeout }); | ||
} | ||
|
||
static async waitForAggregates(page: Page, timeout?: number): Promise<void> { | ||
await page.locator('.table-column-spinner').waitFor({ state: 'hidden', timeout }); | ||
} | ||
|
||
static async waitForAggregates(page: Page) { | ||
page.locator('.table-column-spinner').waitFor({ state: 'hidden' }); | ||
static getPageTitleElement(page: Page): Locator { | ||
return page.locator('page-title'); | ||
} | ||
|
||
static getRecordSetTable(page: Page): Locator { | ||
return page.locator('.recordset-table'); | ||
} | ||
|
||
static getFacetFilters(page: Page): Locator { | ||
return page.locator('.chiclets-container .filter-chiclet'); | ||
} | ||
|
||
} |
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.