generated from acdh-oeaw/template-app-nuxt
-
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
eeabc78
commit 2184cbb
Showing
9 changed files
with
106 additions
and
77 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 |
---|---|---|
@@ -1,48 +1,68 @@ | ||
import { expect } from '@playwright/test'; | ||
import { expect } from "@playwright/test"; | ||
|
||
import { login as test } from '../fixtures/corpsum.fixtures'; | ||
import { login as test } from "../fixtures/corpsum.fixtures"; | ||
|
||
const account = { username: process.env.TEST_USER!, password: process.env.TEST_PASSWORD! }; | ||
test.use({ account }); | ||
|
||
test.describe("Query Interface", () => { | ||
test('should be able to display information on multiple queries', async ({ page }) => { | ||
await page.getByRole('combobox').first().click(); | ||
const corpusPromise = page.waitForResponse('https://noskecrystal5corpsum.acdh-dev.oeaw.ac.at/run.cgi/corp_info?corpname=amc_4.2&subcorpora=1&format=json'); | ||
await page.getByRole('option', { name: 'amc_4.2' }).click(); | ||
test("should be able to display information on multiple queries", async ({ page }) => { | ||
await page.getByRole("combobox").first().click(); | ||
const corpusPromise = page.waitForResponse( | ||
"https://noskecrystal5corpsum.acdh-dev.oeaw.ac.at/run.cgi/corp_info?corpname=amc_4.2&subcorpora=1&format=json", | ||
); | ||
await page.getByRole("option", { name: "amc_4.2" }).click(); | ||
await corpusPromise; | ||
await expect(page.locator('form')).toContainText('Number of tokens:'); | ||
await page.getByPlaceholder('Your search term').fill('haus') | ||
await page.getByPlaceholder('Your search term').press('Enter'); | ||
await expect(page.locator('div:nth-child(1) > .v-card-title > div > .text-xl')).toBeVisible(); | ||
await expect(page.locator('div:nth-child(1) > .v-card-title > div > .text-xl')).toHaveText('haus'); | ||
await expect(page.locator('.flex > span > .v-chip__content').first()).toBeVisible() | ||
await expect(page.locator('.flex > span > .v-chip__content').first()).toHaveText('amc_4.2'); | ||
await expect(page.locator('.flex > span > .v-chip__content').nth(1)).toBeVisible(); | ||
await expect(page.locator('.flex > span > .v-chip__content').nth(1)).toHaveText('iqueryrow'); | ||
await expect(page.locator("form")).toContainText("Number of tokens:"); | ||
await page.getByPlaceholder("Your search term").fill("haus"); | ||
await page.getByPlaceholder("Your search term").press("Enter"); | ||
await expect(page.locator("div:nth-child(1) > .v-card-title > div > .text-xl")).toBeVisible(); | ||
await expect(page.locator("div:nth-child(1) > .v-card-title > div > .text-xl")).toHaveText( | ||
"haus", | ||
); | ||
await expect(page.locator(".flex > span > .v-chip__content").first()).toBeVisible(); | ||
await expect(page.locator(".flex > span > .v-chip__content").first()).toHaveText("amc_4.2"); | ||
await expect(page.locator(".flex > span > .v-chip__content").nth(1)).toBeVisible(); | ||
await expect(page.locator(".flex > span > .v-chip__content").nth(1)).toHaveText("iqueryrow"); | ||
|
||
await page.getByRole('combobox').first().click(); | ||
await page.getByRole('option', { name: 'amc_3.2' }).click(); | ||
await page.getByRole('combobox').nth(2).click(); | ||
await page.getByRole('option', { name: 'Word search' }).click(); | ||
await page.getByPlaceholder('Your search term').click(); | ||
await page.getByPlaceholder('Your search term').fill('tomate'); | ||
await page.getByPlaceholder('Your search term').press('Enter'); | ||
await expect(page.locator('div:nth-child(2) > .v-card-title > div > .text-xl')).toBeVisible(); | ||
await expect(page.locator('div:nth-child(2) > .v-card-title > div > .text-xl')).toHaveText('tomate'); | ||
await expect(page.locator('div:nth-child(2) > .v-card-text > .flex > span > .v-chip__content').first()).toBeVisible() | ||
await expect(page.locator('div:nth-child(2) > .v-card-text > .flex > span > .v-chip__content').first()).toHaveText('amc_3.2'); | ||
await expect(page.locator('div:nth-child(2) > .v-card-text > .flex > span > .v-chip__content').nth(1)).toBeVisible(); | ||
await expect(page.locator('div:nth-child(2) > .v-card-text > .flex > span > .v-chip__content').nth(1)).toHaveText('wordrow'); | ||
await page.getByRole("combobox").first().click(); | ||
await page.getByRole("option", { name: "amc_3.2" }).click(); | ||
await page.getByRole("combobox").nth(2).click(); | ||
await page.getByRole("option", { name: "Word search" }).click(); | ||
await page.getByPlaceholder("Your search term").click(); | ||
await page.getByPlaceholder("Your search term").fill("tomate"); | ||
await page.getByPlaceholder("Your search term").press("Enter"); | ||
await expect(page.locator("div:nth-child(2) > .v-card-title > div > .text-xl")).toBeVisible(); | ||
await expect(page.locator("div:nth-child(2) > .v-card-title > div > .text-xl")).toHaveText( | ||
"tomate", | ||
); | ||
await expect( | ||
page.locator("div:nth-child(2) > .v-card-text > .flex > span > .v-chip__content").first(), | ||
).toBeVisible(); | ||
await expect( | ||
page.locator("div:nth-child(2) > .v-card-text > .flex > span > .v-chip__content").first(), | ||
).toHaveText("amc_3.2"); | ||
await expect( | ||
page.locator("div:nth-child(2) > .v-card-text > .flex > span > .v-chip__content").nth(1), | ||
).toBeVisible(); | ||
await expect( | ||
page.locator("div:nth-child(2) > .v-card-text > .flex > span > .v-chip__content").nth(1), | ||
).toHaveText("wordrow"); | ||
}); | ||
test('should be able select a corpus and select the available subcorpora', async ({ page }) => { | ||
await page.getByRole('combobox').first().click(); | ||
const corpusPromise = page.waitForResponse('https://noskecrystal5corpsum.acdh-dev.oeaw.ac.at/run.cgi/corp_info?corpname=amc_4.2&subcorpora=1&format=json'); | ||
await page.getByRole('option', { name: 'amc_4.2' }).click(); | ||
test("should be able select a corpus and select the available subcorpora", async ({ page }) => { | ||
await page.getByRole("combobox").first().click(); | ||
const corpusPromise = page.waitForResponse( | ||
"https://noskecrystal5corpsum.acdh-dev.oeaw.ac.at/run.cgi/corp_info?corpname=amc_4.2&subcorpora=1&format=json", | ||
); | ||
await page.getByRole("option", { name: "amc_4.2" }).click(); | ||
await corpusPromise; | ||
await expect(page.locator('form')).toContainText('Number of tokens:'); | ||
await page.getByRole('combobox').nth(1).click(); | ||
await page.locator('div').filter({ hasText: /^AustriazismenSFB$/ }).first().click(); | ||
await expect(page.locator('form')).toContainText('tokens:'); | ||
await expect(page.locator("form")).toContainText("Number of tokens:"); | ||
await page.getByRole("combobox").nth(1).click(); | ||
await page | ||
.locator("div") | ||
.filter({ hasText: /^AustriazismenSFB$/ }) | ||
.first() | ||
.click(); | ||
await expect(page.locator("form")).toContainText("tokens:"); | ||
}); | ||
}); |
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,17 +1,19 @@ | ||
import { expect } from '@playwright/test'; | ||
import { expect } from "@playwright/test"; | ||
|
||
import { search as test } from '../fixtures/corpsum.fixtures'; | ||
import { search as test } from "../fixtures/corpsum.fixtures"; | ||
|
||
const account = { username: process.env.TEST_USER!, password: process.env.TEST_PASSWORD! }; | ||
test.use({ account, term: 'haus' }); | ||
test.use({ account, term: "haus" }); | ||
|
||
test.describe("Search Result Display", () => { | ||
test('should be able to display result information on selected searches', async ({page}) => { | ||
await expect(page.locator('div:nth-child(1) > .v-card-title > div > .text-xl')).toBeVisible(); | ||
await expect(page.locator('div:nth-child(1) > .v-card-title > div > .text-xl')).toHaveText('haus'); | ||
await expect(page.locator('.flex > span > .v-chip__content').first()).toBeVisible() | ||
await expect(page.locator('.flex > span > .v-chip__content').first()).toHaveText('amc_4.2'); | ||
await expect(page.locator('.flex > span > .v-chip__content').nth(1)).toBeVisible(); | ||
await expect(page.locator('.flex > span > .v-chip__content').nth(1)).toHaveText('iqueryrow'); | ||
test("should be able to display result information on selected searches", async ({ page }) => { | ||
await expect(page.locator("div:nth-child(1) > .v-card-title > div > .text-xl")).toBeVisible(); | ||
await expect(page.locator("div:nth-child(1) > .v-card-title > div > .text-xl")).toHaveText( | ||
"haus", | ||
); | ||
await expect(page.locator(".flex > span > .v-chip__content").first()).toBeVisible(); | ||
await expect(page.locator(".flex > span > .v-chip__content").first()).toHaveText("amc_4.2"); | ||
await expect(page.locator(".flex > span > .v-chip__content").nth(1)).toBeVisible(); | ||
await expect(page.locator(".flex > span > .v-chip__content").nth(1)).toHaveText("iqueryrow"); | ||
}); | ||
}); |
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
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