Skip to content

Commit f79051b

Browse files
committed
- remove acceptance test
- replace it with e2e playwright test
1 parent 46a025d commit f79051b

File tree

2 files changed

+34
-13
lines changed

2 files changed

+34
-13
lines changed

tests/acceptance/SettingsPageCest.php

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { describe, test, expect, beforeEach } from '@playwright/test'
2+
import { loginToWordPressAdmin, visitAdminFacingPage, wpAdminUrl } from '../utils'
3+
4+
const selectors = {
5+
graphiqlEnabledCheckbox: '#wpuf-graphql_general_settings\\[graphiql_enabled\\]',
6+
}
7+
8+
describe( 'Settings Page', () => {
9+
10+
beforeEach( async ({ page }) => {
11+
await loginToWordPressAdmin( page );
12+
await page.evaluate(() => localStorage.clear());
13+
});
14+
15+
test( 'GraphiQL IDE can be disabled', async ({ page }) => {
16+
await visitAdminFacingPage( page, wpAdminUrl + '/admin.php?page=graphql-settings' );
17+
// await page.goto('http://localhost:8888/wp-login.php?redirect_to=http%3A%2F%2Flocalhost%3A8888%2Fwp-admin%2F&reauth=1');
18+
19+
await page.waitForTimeout( 500 );
20+
await expect( page.locator(selectors.graphiqlEnabledCheckbox ) ).toBeChecked();
21+
await page.locator(selectors.graphiqlEnabledCheckbox ).uncheck();
22+
await page.getByRole('button', { name: 'Save Changes' }).click();
23+
await page.waitForTimeout( 500 );
24+
await expect(page.getByText('Settings saved.')).toBeVisible();
25+
await expect( page.locator(selectors.graphiqlEnabledCheckbox ) ).not.toBeChecked();
26+
await page.locator( selectors.graphiqlEnabledCheckbox ).check();
27+
await page.getByRole('button', { name: 'Save Changes' }).click();
28+
await page.waitForTimeout( 500 );
29+
await expect(page.getByText('Settings saved.')).toBeVisible();
30+
await expect( page.locator( selectors.graphiqlEnabledCheckbox ) ).toBeChecked();
31+
32+
});
33+
34+
});

0 commit comments

Comments
 (0)