mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
test: update commit page selector
This commit is contained in:
parent
3c8e162159
commit
5c04d2c9e2
3 changed files with 4 additions and 4 deletions
|
|
@ -13,13 +13,13 @@ describe(`in Gitako project page`, () => {
|
|||
if (commitLinks.length < 2) throw new Error(`No enough commits`)
|
||||
commitLinks[i].click()
|
||||
await waitForRedirect()
|
||||
await expectToFind(selectors.github.commitSummary)
|
||||
await expectToFind(selectors.github.commitPage)
|
||||
await sleep(1000)
|
||||
|
||||
page.goBack()
|
||||
await sleep(1000)
|
||||
// The selector for file content
|
||||
await expectToNotFind(selectors.github.commitSummary)
|
||||
await expectToNotFind(selectors.github.commitPage)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ export const selectors = {
|
|||
fileListItemFileLinks: `table[aria-labelledby="folders-and-files"] tr.react-directory-row td.react-directory-row-name-cell-large-screen .react-directory-filename-column .react-directory-truncate a[aria-label$="(File)"]`,
|
||||
fileListItemLinkOf: (name: string) =>
|
||||
`table[aria-labelledby="folders-and-files"] tr.react-directory-row td.react-directory-row-name-cell-large-screen .react-directory-filename-column .react-directory-truncate a[title="${name}"]`,
|
||||
commitSummary: 'div.commit',
|
||||
commitPage: ['div.commit', '#diff-content-parent'].join(),
|
||||
navBarItemIssues: 'a[data-selected-links^="repo_issues "]',
|
||||
navBarItemPulls: 'a[data-selected-links^="repo_pulls "]',
|
||||
},
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ export async function expectToReject<T>(promise: Promise<T>) {
|
|||
}
|
||||
|
||||
export async function expectToFind(selector: string) {
|
||||
await expectToResolve(page.waitForSelector(selector))
|
||||
await expectToResolve(page.waitForSelector(selector, { timeout: 2000 }))
|
||||
}
|
||||
|
||||
export async function expectToNotFind(selector: string) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue