Skip to content

Cypress Commands

Paul Taylor edited this page Jan 19, 2022 · 7 revisions
Command Description Params Example
wp Execute the WP CLI Command [String] cy.wp('cli version')
seed Seed the database with the given seeder Seed Name [String] cy.seed('MySeeder')
cleanThenSeed Run the seeder clean method then seed the database Seed Name [String] cy.cleanThenSeed('MySeeder')
seedClean Run the seeder clean method Seed Name [String] cy.seedClean('MySeeder')
installTheme Install a theme Theme Name [String] cy.installTheme('my-theme')
activateTheme Activate a theme Theme Name [String] cy.activateTheme('my-theme')
installPlugin Install a plugin Plugin Name [String] cy.installPlugin('my-plugin')
activatePlugin Activate a plugin Plugin Name [String] cy.activatePlugin('my-plugin')
deactivatePlugin De-activate a plugin Plugin Name [String] cy.deactivatePlugin('my-plugin')
visitAdmin Visit the WordPress admin panel None cy.visitAdmin()
editPost Visit the a post's edit page Post ID [Number] cy.editPost(1)
saveCurrentPost If on a post's edit page, save the post None cy.saveCurrentPost()
setSelection If a text input is active, set the selection. Text to Select [String] cy.get('.editable-element').click().setSelection('selection')
switchUser Log in as a different user. User `[String]`` cy.switchUser('editor')