Skip to content

Commit

Permalink
- update selectors instead of importing them
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonbahl committed Mar 30, 2024
1 parent 7efa238 commit 8083ae4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/e2e/specs/toolbar-buttons.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import {loginToWordPressAdmin, openDrawer, typeQuery, visitAdminFacingPage} from "../utils";
import {expect, test } from "@wordpress/e2e-test-utils-playwright";
import { selectors } from "./drawer.spec";

export const selectors = {
graphiqlContainer: '.graphiql-container',
graphiqlResponse: '.graphiql-response',
editorDrawerButton: '.EditorDrawerButton',
editorDrawerCloseButton: '.EditorDrawerCloseButton',
executeQueryButton: '.graphiql-execute-button',
queryInput: '[aria-label="Query Editor"] .CodeMirror',
variablesInput: '[aria-label="Variables"] .CodeMirror',
};

// Login to WordPress before each test
test.beforeEach( async ( { page } ) => {
Expand Down Expand Up @@ -54,7 +63,7 @@ test.describe( 'Toolbar Buttons', () => {

// Execute the viewer query again
await page.click( '.graphiql-execute-button' );

// The viewer field should exist in the response, but the admin username should not because a public request gets null for the viewer query
await expect( response ).toContainText( 'viewer' );
await expect( response ).not.toContainText( 'admin' );
Expand Down

0 comments on commit 8083ae4

Please sign in to comment.