Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
obulat committed Jul 18, 2023
1 parent 625b07e commit d8a1a0b
Show file tree
Hide file tree
Showing 8 changed files with 5,376 additions and 2 deletions.
5 changes: 4 additions & 1 deletion frontend/test/playwright/e2e/load-more.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { expect, Page, test } from "@playwright/test"

import {
closeFiltersUsingCookies,
dismissAllBannersUsingCookies,
goToSearchTerm,
renderModes,
t,
Expand Down Expand Up @@ -143,11 +145,12 @@ test.describe("Load more button", () => {
context,
}) => {
const analyticsEvents = collectAnalyticsEvents(context)
await dismissAllBannersUsingCookies(page)
await closeFiltersUsingCookies(page)

await page.goto("/search/?q=cat")

await page.locator(loadMoreButton).scrollIntoViewIfNeeded()
await expect(page.locator(loadMoreButton)).toBeVisible()

const reachResultEndEvent = analyticsEvents.find(
(event) => event.n === "REACH_RESULT_END"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ for (const dir of languageDirections) {
await page
.getByRole("contentinfo")
.getByRole("link", { name: "Openverse" })
.hover()
.scrollIntoViewIfNeeded()

await externalSourcesButton.click()
await page.mouse.move(0, 0)

await expectSnapshot(
`external-${searchType}-sources-popover-${dir}`,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ for (const dir of languageDirections) {
await openFiltersTab(page)

await page.locator('input[type="checkbox"]').first().check()
await page.waitForLoadState("load")

await expectSnapshot(`filters-modal-filters-selected-${dir}.png`, page)
})
Expand Down
Loading

0 comments on commit d8a1a0b

Please sign in to comment.