Mattermost Logo
We're hiring!
Edit on GitHub

Folder and File Structure

The folder structure is mostly based on the Cypress scaffold which was created on initial run. Folders and files are:

|-- e2e
  |-- cypress
    |-- fixtures
    |-- integration
    |-- plugins
    |-- support
    |-- utils
  |-- cypress.json
  |-- package-lock.json
  |-- package.json
  1. /e2e/cypress/fixtures or Fixture Files:
    • Fixtures are used as external pieces of static data that can be used by tests.
    • Typically used with the cy.fixture() command and most often when stubbing network requests.
  2. /e2e/cypress/integration or Test Files
    • To start writing tests,
      • Simply create a new file (e.g. login_spec.js) within /e2e/cypress/integration folder and;
      • Refresh tests list in the Cypress Test Runner and a new file should appear in the list.
    • Subfolder naming convention depends on test grouping, which is usually based on the general functional area (e.g. /e2e/cypress/integration/messaging/ for “Messaging”).
    • Test cases that require an Enterprise license should fall under /e2e/cypress/integration/enterprise/. This is to easily identify license requirements, both during local development and production testing for Enterprise features.
  3. /e2e/cypress/plugins or Plugin Files
    • A convenience mechanism that automatically includes the plugins before running every single spec file.
  4. /e2e/cypress/support or Support Files
    • A support file is a place for reusable behaviour such as Custom Commands or global overrides that are available and can be applied to all spec files.
  5. /e2e/cypress/utils for common utility functions.
  6. /e2e/cypress.json for Cypress configuration.
  7. /e2e/package.json for all dependencies related to Cypress end-to-end testing.