mirror of
https://github.com/penpot/penpot.git
synced 2025-05-10 09:06:37 +02:00
✨ Add visual testing to viewer
This commit is contained in:
parent
5e7180b054
commit
f3193a1984
6 changed files with 147 additions and 22 deletions
|
@ -27,6 +27,26 @@ export class ViewerPage extends BaseWebSocketPage {
|
|||
);
|
||||
}
|
||||
|
||||
async setupFileWithSingleBoard() {
|
||||
await this.mockRPC(/get\-view\-only\-bundle\?/, "viewer/get-view-only-bundle-single-board.json");
|
||||
await this.mockRPC("get-comment-threads?file-id=*", "workspace/get-comment-threads-empty.json");
|
||||
await this.mockRPC(
|
||||
"get-file-fragment?file-id=*&fragment-id=*",
|
||||
"viewer/get-file-fragment-single-board.json",
|
||||
);
|
||||
};
|
||||
|
||||
async setupFileWithComments() {
|
||||
await this.mockRPC(/get\-view\-only\-bundle\?/, "viewer/get-view-only-bundle-single-board.json");
|
||||
await this.mockRPC("get-comment-threads?file-id=*", "workspace/get-comment-threads-not-empty.json");
|
||||
await this.mockRPC(
|
||||
"get-file-fragment?file-id=*&fragment-id=*",
|
||||
"viewer/get-file-fragment-single-board.json",
|
||||
);
|
||||
await this.mockRPC("get-comments?thread-id=*", "workspace/get-thread-comments.json");
|
||||
await this.mockRPC("update-comment-thread-status", "workspace/update-comment-thread-status.json");
|
||||
};
|
||||
|
||||
#ws = null;
|
||||
|
||||
constructor(page) {
|
||||
|
@ -56,5 +76,11 @@ export class ViewerPage extends BaseWebSocketPage {
|
|||
.filter({ hasText: number.toString() })
|
||||
.click(clickOptions);
|
||||
}
|
||||
|
||||
async showCode(clickOptions = {}) {
|
||||
await this.page
|
||||
.getByRole("button", { name: 'Inspect (G I)' })
|
||||
.click(clickOptions);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue