-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #173 from wp-graphql/feat/issue-55-prep-for-wporg
feat: Add link to settings page
- Loading branch information
Showing
3 changed files
with
50 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"wpgraphql-ide": patch | ||
--- | ||
|
||
- Add settings link to the IDE Settings tab from the WordPress settings page. |
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,28 @@ | ||
import { loginToWordPressAdmin, visitPluginsPage, wpAdminUrl } from '../utils.js'; | ||
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' ); | ||
|
||
export const selectors = { | ||
pluginsMenuItem: '#menu-plugins a', | ||
pluginSettingsLink: 'a[href*="graphql-settings#graphql_ide_settings"]', | ||
ideSettingsTab: '#graphql_ide_settings-tab', | ||
}; | ||
|
||
// Login to WordPress before each test | ||
test.beforeEach( async ( { page } ) => { | ||
await loginToWordPressAdmin( page ); | ||
} ); | ||
|
||
test( 'should navigate to plugin settings and display IDE Settings tab', async ( { page } ) => { | ||
// Go to Plugins page | ||
await visitPluginsPage( page ); | ||
|
||
// Click on the plugin settings link | ||
await page.click( selectors.pluginSettingsLink ); | ||
|
||
// Correct the expected URL string | ||
const expectedUrl = `${wpAdminUrl}/admin.php?page=graphql-settings#graphql_ide_settings`; | ||
await expect( page ).toHaveURL( expectedUrl ); | ||
|
||
// Check that the IDE Settings tab is visible | ||
await expect( page.locator( selectors.ideSettingsTab ) ).toBeVisible(); | ||
} ); |
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