-
Notifications
You must be signed in to change notification settings - Fork 605
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix multi pcd e2e * fix media visibility toggler e2e
- Loading branch information
1 parent
225f26c
commit 3de1338
Showing
4 changed files
with
88 additions
and
18 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Locator, Page } from "src/oss/fixtures"; | ||
|
||
export class Asset3dPanelPom { | ||
readonly locator: Locator; | ||
readonly headerLocator: Locator; | ||
|
||
constructor(private readonly page: Page) { | ||
this.locator = this.page.getByTestId("leva-container"); | ||
this.headerLocator = this.page.getByTestId("leva-container-header"); | ||
} | ||
|
||
async dragToToLeftCorner() { | ||
await this.headerLocator.waitFor({ state: "visible" }); | ||
|
||
const levaContainerBox = await this.locator.boundingBox(); | ||
|
||
if (!levaContainerBox) { | ||
throw new Error("Unable to find bounding box on leva container"); | ||
} | ||
|
||
const dragXOffset = -this.page.viewportSize().width / 2; | ||
const dragYOffset = -10; | ||
|
||
const levaCenterX = levaContainerBox.x + levaContainerBox.width / 2; | ||
const levaCenterY = levaContainerBox.y + levaContainerBox.height / 2; | ||
|
||
await this.headerLocator.hover(); | ||
|
||
await this.page.mouse.down(); | ||
await this.page.mouse.move( | ||
levaCenterX + dragXOffset, | ||
levaCenterY + dragYOffset | ||
); | ||
await this.page.mouse.up(); | ||
} | ||
} |
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