-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
index.ts
69 lines (64 loc) · 2.63 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/**
* External dependencies
*/
import type { Browser, Page, BrowserContext } from '@playwright/test';
/**
* Internal dependencies
*/
import { canvas } from './canvas';
import { clickBlockToolbarButton } from './click-block-toolbar-button';
import { clickOnCloseModalButton } from './click-on-close-modal-button';
import { clickOnMoreMenuItem } from './click-on-more-menu-item';
import { createNewPost } from './create-new-post';
import { getCurrentUser } from './get-current-user';
import { getPageError } from './get-page-error';
import { isCurrentURL } from './is-current-url';
import { loginUser } from './login-user';
import { showBlockToolbar } from './show-block-toolbar';
import { switchUserToAdmin } from './switch-user-to-admin';
import { switchUserToTest } from './switch-user-to-test';
import { toggleMoreMenu } from './toggle-more-menu';
import { visitAdminPage } from './visit-admin-page';
import { wpDataSelect } from './wp-data-select';
import { focusSelectedBlock } from './inserter/focus-selected-block';
import { insertBlock } from './inserter/insert-block';
import { isGlobalInserterOpen } from './inserter/is-global-inserter-open';
import { openGlobalBlockInserter } from './inserter/open-global-block-inserter';
import { searchForBlock } from './inserter/search-term';
import { toggleGlobalBlockInserter } from './inserter/toggle-global-block-inserter';
import { waitForInserterCloseAndContentFocus } from './inserter/wait-for-inserter-close-and-content-focus';
import { getEditedPostContent } from './get-edited-post-content';
class PageUtils {
browser: Browser;
page: Page;
context: BrowserContext;
constructor( page: Page ) {
this.page = page;
this.context = page.context();
this.browser = this.context.browser()!;
}
canvas = canvas;
clickBlockToolbarButton = clickBlockToolbarButton;
clickOnCloseModalButton = clickOnCloseModalButton;
clickOnMoreMenuItem = clickOnMoreMenuItem;
createNewPost = createNewPost;
getCurrentUser = getCurrentUser;
getPageError = getPageError;
isCurrentURL = isCurrentURL;
loginUser = loginUser;
showBlockToolbar = showBlockToolbar;
switchUserToAdmin = switchUserToAdmin;
switchUserToTest = switchUserToTest;
toggleMoreMenu = toggleMoreMenu;
visitAdminPage = visitAdminPage;
wpDataSelect = wpDataSelect;
focusSelectedBlock = focusSelectedBlock;
insertBlock = insertBlock;
isGlobalInserterOpen = isGlobalInserterOpen;
openGlobalBlockInserter = openGlobalBlockInserter;
searchForBlock = searchForBlock;
toggleGlobalBlockInserter = toggleGlobalBlockInserter;
waitForInserterCloseAndContentFocus = waitForInserterCloseAndContentFocus;
getEditedPostContent = getEditedPostContent;
}
export { PageUtils };