PHP Trait Codeception\Module\WPBrowserMethods

Show file Open project: lucatume/wp-browser

Public Methods

Method Description
activatePlugin ( string $pluginSlug ) : void In the plugin administration screen activates a plugin clicking the "Activate" link.
amOnAdminPage ( $path )
amOnPagesPage ( ) : void Navigates the browser to the Pages administration screen.
amOnPluginsPage ( ) : void Navigates the browser to the plugins administration screen.
deactivatePlugin ( string $pluginSlug ) : void In the plugin administration screen deactivates a plugin clicking the "Deactivate" link.
dontSeePluginInstalled ( string $pluginSlug ) : void Looks for a missing plugin in the plugin administration screen.
grabWordPressAuthCookie ( null $pattern = null ) : mixed Returns WordPress default auth cookie if present.
grabWordPressLoginCookie ( null $pattern = null ) : mixed Returns WordPress default login cookie if present.
grabWordPressTestCookie ( null $pattern = null ) : mixed Returns WordPress default test cookie if present.
loginAs ( string $username, string $password ) : array Goes to the login page and logs in using the given credentials.
loginAsAdmin ( ) : array Goes to the login page and logs in as the site admin.
seeErrorMessage ( array $classes = '' ) : void In an administration screen will look for an error message.
seeMessage ( array $classes = '' ) : void In an administration screen will look for a message.
seePluginActivated ( string $pluginSlug ) : void Looks for an activated plugin in the plugin administration screen.
seePluginDeactivated ( string $pluginSlug ) : void Looks for a deactivated plugin in the plugin administration screen.
seePluginInstalled ( string $pluginSlug ) : void Looks for a plugin in the plugin administration screen.
seeWpDiePage ( ) : void Checks that the current page is a wp_die generated one.

Method Details

activatePlugin() public method

The method will presume the browser is in the plugin screen already.
public activatePlugin ( string $pluginSlug ) : void
$pluginSlug string The plugin slug, like "hello-dolly".
return void

amOnAdminPage() public method

public amOnAdminPage ( $path )

amOnPagesPage() public method

Makes no check about the user being logged in and authorized to do so.
public amOnPagesPage ( ) : void
return void

amOnPluginsPage() public method

Makes no check about the user being logged in and authorized to do so.
public amOnPluginsPage ( ) : void
return void

deactivatePlugin() public method

The method will presume the browser is in the plugin screen already.
public deactivatePlugin ( string $pluginSlug ) : void
$pluginSlug string The plugin slug, like "hello-dolly".
return void

dontSeePluginInstalled() public method

Will not navigate to the plugin administration screen.
public dontSeePluginInstalled ( string $pluginSlug ) : void
$pluginSlug string The plugin slug, like "hello-dolly".
return void

grabWordPressAuthCookie() public method

Returns WordPress default auth cookie if present.
public grabWordPressAuthCookie ( null $pattern = null ) : mixed
$pattern null Optional, overrides the default cookie name.
return mixed Either a cookie or null.

grabWordPressLoginCookie() public method

Returns WordPress default login cookie if present.
public grabWordPressLoginCookie ( null $pattern = null ) : mixed
$pattern null Optional, overrides the default cookie name.
return mixed Either a cookie or null.

grabWordPressTestCookie() public method

Returns WordPress default test cookie if present.
public grabWordPressTestCookie ( null $pattern = null ) : mixed
$pattern null Optional, overrides the default cookie name.
return mixed Either a cookie or null.

loginAs() public method

Goes to the login page and logs in using the given credentials.
public loginAs ( string $username, string $password ) : array
$username string
$password string
return array An array of login credentials and auth cookies.

loginAsAdmin() public method

Goes to the login page and logs in as the site admin.
public loginAsAdmin ( ) : array
return array An array of login credentials and auth cookies.

seeErrorMessage() public method

Allows for class-based error checking to decouple from internationalization.
public seeErrorMessage ( array $classes = '' ) : void
$classes array A list of classes the error notice should have.
return void

seeMessage() public method

Allows for class-based error checking to decouple from internationalization.
public seeMessage ( array $classes = '' ) : void
$classes array A list of classes the message should have.
return void

seePluginActivated() public method

Will not navigate to the plugin administration screen.
public seePluginActivated ( string $pluginSlug ) : void
$pluginSlug string The plugin slug, like "hello-dolly".
return void

seePluginDeactivated() public method

Will not navigate to the plugin administration screen.
public seePluginDeactivated ( string $pluginSlug ) : void
$pluginSlug string The plugin slug, like "hello-dolly".
return void

seePluginInstalled() public method

Will not navigate to the plugin administration screen.
public seePluginInstalled ( string $pluginSlug ) : void
$pluginSlug string The plugin slug, like "hello-dolly".
return void

seeWpDiePage() public method

Checks that the current page is a wp_die generated one.
public seeWpDiePage ( ) : void
return void