-
Notifications
You must be signed in to change notification settings - Fork 4
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
4bb5d20
commit 8170e88
Showing
16 changed files
with
79 additions
and
52 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
Binary file added
BIN
+445 KB
...rome/workflows/search_and_bounce.spec.ts/Modern-Form---Results---Abstract-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+174 KB
...rome/workflows/search_and_bounce.spec.ts/Modern-Form---Results---Abstract-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+223 KB
...rome/workflows/search_and_bounce.spec.ts/Modern-Form---Results---Abstract-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,6 +1,24 @@ | ||
import { expect, PlaywrightTestArgs } from '@playwright/test'; | ||
import { expect, Page, PlaywrightTestArgs } from '@playwright/test'; | ||
import { AppMode } from '@types'; | ||
|
||
export const checkQuery = (page: PlaywrightTestArgs['page'], query: string) => { | ||
const search = new URL(page.url()).searchParams; | ||
expect(search.get('q')).toBe(query); | ||
}; | ||
|
||
export const routes = { | ||
home: '/', | ||
classicForm: '/classic-form', | ||
paperForm: '/paper-form', | ||
}; | ||
|
||
export const searchbar = { | ||
async submitQuery(page: Page, query?: string) { | ||
await page.getByTestId('search-input').fill(query); | ||
await page.getByTestId('search-input').press('Enter'); | ||
}, | ||
}; | ||
|
||
export const changeAppMode = async (page: Page, mode: `${AppMode}`) => { | ||
await page.locator('#theme-selector div').nth(4).click(); | ||
}; |
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,47 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { changeAppMode, routes, searchbar } from '../helpers'; | ||
|
||
test.describe.configure({ | ||
mode: 'parallel', | ||
}); | ||
|
||
test('Classic Form -> Results -> Abstract', async ({ page }) => { | ||
await page.goto(routes.home); | ||
await changeAppMode(page, 'ASTROPHYSICS'); | ||
}); | ||
|
||
test('Modern Form -> Results -> Abstract', async ({ page }) => { | ||
const id = '1985ARA&A..23..169D'; | ||
await page.goto(routes.home); | ||
await expect(page).toHaveScreenshot({ fullPage: true }); | ||
await searchbar.submitQuery(page, `identifier:${id}`); | ||
await page.waitForURL(`/search*`, { waitUntil: 'domcontentloaded' }); | ||
await expect(page).toHaveScreenshot({ fullPage: true }); | ||
await page.getByRole('link', { name: 'Radio emission' }).click(); | ||
await page.waitForURL(`/abs/${id}/abstract`, { waitUntil: 'load' }); | ||
await expect(page).toHaveScreenshot({ fullPage: true }); | ||
|
||
// check for headings | ||
const headings = await page.getByRole('heading').all(); | ||
expect(headings).toHaveLength(4); | ||
await expect(headings[0]).toHaveText(/.*Radio emission.*/i); | ||
await expect(headings[1]).toHaveText('Authors'); | ||
await expect(headings[2]).toHaveText('Abstract'); | ||
await expect(headings[3]).toHaveText('Details'); | ||
|
||
// check for resource accordion | ||
await expect(page.getByRole('button', { name: 'Full Text Sources' })).toBeVisible(); | ||
await expect(page.getByRole('button', { name: 'Data Products' })).toBeVisible(); | ||
await expect(page.getByRole('button', { name: 'Related Materials' })).toBeVisible(); | ||
|
||
// check for navigation | ||
await expect(page.getByRole('link', { name: 'Abstract' })).toBeVisible(); | ||
await expect(page.getByRole('link', { name: 'References' })).toBeVisible(); | ||
await expect(page.getByRole('link', { name: 'Citations' })).toBeVisible(); | ||
await expect(page.getByRole('link', { name: 'Similar Papers' })).toBeVisible(); | ||
await expect(page.getByRole('link', { name: 'Metrics' })).toBeVisible(); | ||
await expect(page.getByRole('link', { name: 'Co-Reads' })).toBeVisible(); | ||
await expect(page.getByRole('link', { name: 'Volume Content' })).toBeVisible(); | ||
await expect(page.getByRole('link', { name: 'Graphics' })).toBeVisible(); | ||
await expect(page.getByRole('link', { name: 'Export Citation' })).toBeVisible(); | ||
}); |
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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