From 1b03f70d7c454d63a8c56023dcc57f0ee6b6be08 Mon Sep 17 00:00:00 2001 From: sksaju Date: Mon, 25 Nov 2024 00:59:49 +0600 Subject: [PATCH] update createPost support command --- tests/cypress/support/commands.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index 4136e78..3f87243 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -10,6 +10,10 @@ Cypress.Commands.add('setLocalStorage', (key, value) => { // Create a new post Cypress.Commands.add('createPost', ({ title = '' } = {}) => { cy.visit('/wp-admin/post-new.php'); + + // Wait for the editor to load + cy.get('.editor-post-title__input', { timeout: 10000 }).should('be.visible'); + if (title) { cy.get('.editor-post-title__input').type(`${title} - ${Date.now()}`); }