Add to Cheatsheet: Create support command for content type creation

Created on 20 November 2023, 7 months ago
Updated 1 December 2023, 7 months ago

Pseudocode Proposal:

  • In the support folder, add a file named createEvent.js
  • Create the test (code below)
  • Document that they should verify e2e.js in the support folder imports the commands with import './commands'
Cypress.Commands.add("createEvent", () => {
  cy.visit('/node/add/event')

  // Set title.
  const nodeTitle = "TEST CONTENT - " +  randCompanyName();
  cy.get("#edit-title-wrapper").type(nodeTitle);

  // Set body.
  const nodeBody = randLines();
  cy.ckeditorType('#edit-body-wrapper', nodeBody);

  // Set image.
  cy.mediaLibrarySelect('#field_image-media-library-wrapper', 'cypress_test.jpg', 'image')

  // Save the node.
  cy.get("#edit-submit--2--gin-edit-form").click();

  // Validate.
  cy.get('main').should('contain', nodeTitle);
  cy.get('main').should('contain', nodeBody);
});
✨ Feature request
Status

Fixed

Component

Commands

Created by

πŸ‡ΊπŸ‡ΈUnited States Stockfoot

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024