How to use the @wordpress/e2e-test-utils/build/visit-admin-page.visitAdminPage function in @wordpress/e2e-test-utils

To help you get started, we’ve selected a few @wordpress/e2e-test-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ampproject / amp-wp / tests / e2e / specs / amp-onboarding / exit-links.js View on Github external
it( 'returns to previous page when clicking close', async () => {
		await visitAdminPage( 'index.php' );
		await page.waitForSelector( '.wp-admin' );

		await page.evaluate( () => {
			document.querySelector( 'a[href="admin.php?page=amp-onboarding-wizard"]' ).click();
		} );
		await page.waitForSelector( '#amp-onboarding-wizard' );
		await expect( page ).toClick( 'a', { text: 'Close' } );
		await page.waitForSelector( '.wp-admin' );
		await expect( page ).toMatchElement( 'h1', { text: 'Dashboard' } );
	} );
github ampproject / amp-wp / tests / e2e / specs / admin / mobile-redirect.js View on Github external
it.skip( 'persists the mobile redirect setting off', async () => {
		await completeWizard( { mode: 'reader', mobileRedirect: false } );
		await visitAdminPage( 'admin.php', 'page=amp-options' );

		await expect( page ).toClick( '.advanced-settings-container' );
		await page.waitForSelector( toggleSelector );
		await expect( page ).not.toMatchElement( `${ toggleSelector }:checked` );
	} );
} );
github ampproject / amp-wp / tests / e2e / specs / admin / mobile-redirect.js View on Github external
afterEach( async () => {
		await visitAdminPage( 'admin.php', 'page=amp-onboarding-wizard' );
		await cleanUpSettings();
	} );