Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix tagger e2e tests #4783

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e-pw/src/oss/poms/action-row/tagger/modal-tagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export class ModalTaggerPom {
}

async toggleOpen() {
await this.locator.getByTestId("tagger-container").hover();
await this.modal.locator.getByTestId("action-tag-sample-labels").click();
await this.locator.getByTestId("tagger-container").hover();
}

async switchTagMode(mode: "sample" | "label") {
Expand Down
15 changes: 14 additions & 1 deletion e2e-pw/src/oss/poms/modal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { expect, Locator, Page } from "src/oss/fixtures";
import { EventUtils } from "src/shared/event-utils";
import { Duration } from "../../utils";
import { ModalTaggerPom } from "../action-row/tagger/modal-tagger";
import { ModalPanelPom } from "../panels/modal-panel";
import { UrlPom } from "../url";
import { ModalGroupActionsPom } from "./group-actions";
import { Looker3DControlsPom } from "./looker-3d-controls";
import { ModalSidebarPom } from "./modal-sidebar";
import { ModalVideoControlsPom } from "./video-controls";
import { ModalPanelPom } from "../panels/modal-panel";

export class ModalPom {
readonly groupCarousel: Locator;
Expand Down Expand Up @@ -86,6 +86,19 @@ export class ModalPom {
);
}

async hideControls() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this 🙇

let isControlsOpacityZero = false;
const controls = this.locator.getByTestId("looker-controls");

do {
await controls.press("c");
const opacity = await controls.evaluate(
(e) => getComputedStyle(e).opacity
);
isControlsOpacityZero = parseFloat(opacity) === 0;
} while (!isControlsOpacityZero);
}

async toggleSelection(isPcd = false) {
if (isPcd) {
await this.looker3d.hover();
Expand Down
4 changes: 2 additions & 2 deletions e2e-pw/src/oss/specs/smoke-tests/tagger.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ test.describe("tag", () => {
eventUtils,
grid,
modal,
page,
}) => {
await grid.openFirstSample();

await modal.sidebar.toggleLabelCheckbox("ground_truth");
await modal.hideControls();
await expect(modal.looker).toHaveScreenshot("labels.png");

const entryExpandPromise = eventUtils.getEventReceivedPromiseForPredicate(
Expand All @@ -124,7 +124,7 @@ test.describe("tag", () => {
await modal.tagger.addLabelTag("correct");

await modal.sidebar.clearGroupFilters("labels");
await page.keyboard.press("c");
await modal.hideControls();
await expect(modal.looker).toHaveScreenshot("labels.png");
});
});
Loading