Back to Kibana

Cypress vs Scout Differences

.agents/skills/cypress-to-scout-migration/references/cypress-vs-scout-differences.md

9.4.04.7 KB
Original Source

Cypress vs Scout Differences

Table of Contents

Folder Structure

AspectCypressScout
LocationCentralized test folder (test/<solution>_cypress/)Tests closer to the plugin (<plugin>/test/scout/)
Organizationcypress/e2e/<domain>/test/scout/ui/{tests,parallel_tests}/

Authentication

AspectCypressScout
ESSBasic authenticationSAML authentication
ServerlessSAML authenticationSAML authentication
Auth helpersCustom login tasksbrowserAuth.loginAsAdmin(), loginAsViewer(), loginAsPrivilegedUser(), loginWithCustomRole()

Scout uses SAML for both ESS and Serverless, making auth consistent across environments.

CI Test Execution & Parallelization

AspectCypressScout
Environment per specEach spec runs in a clean environmentSpec files share the same environment
Data isolationAutomatic (clean environment)Manual (different Kibana spaces via spaceTest)
Parallelization controlparallelism attribute in Buildkite YAMLworkers attribute in Playwright config
Parallelization methodSpec files distributed between CI jobsTests run in parallel in same Kibana/ES instances, isolated by spaces

Critical implication: In Scout, data created by one test may affect others. Use spaceTest + scoutSpace for isolation, and clean up in afterAll. Most Cypress tests have no cleanup logic because the environment is reset per spec. When migrating, you must independently audit what the test creates and add explicit cleanup.

MKI Pipelines

Scout now runs on MKI via the Appex QA Serverless Scout pipeline. Cypress tests with @serverless tags no longer need to be kept solely for MKI coverage — Scout can replace them.

Local Test Execution

AspectCypressScout
Environment setupCypress creates the environment automaticallyYou must create the environment first
Server startAutomaticnode scripts/scout.js start-server --arch stateful --domain classic in a separate terminal
Running testsOpen Cypress UI or cypress runnode scripts/scout.js run-tests --arch stateful --domain security_complete --testFiles <path>

Test Labels/Tags

AspectCypressScout
Label typeNegative tags allowed (@skipInEss, @skipInServerless)Positive tags only (due to Playwright's design)
Skip mechanism@skipInEss, @skipInServerless, @skipInServerlessMKINo equivalent skip tags — use positive tags to include
ValidationNo runtime validationScout validates UI tags at runtime

Test Patterns

CypressScout
Screens (selector files)Page objects (class with locators + methods)
Tasks (action files)Page object methods
Direct cy.get() in testspage.testSubj.locator() via page objects
No EUI abstractionEUI wrappers (EuiComboBoxWrapper, EuiDataGridWrapper, etc.)

Serverless Tiers & Feature Flags

AspectCypressScout
Serverless tier configftrConfig attribute in spec fileTest tags
Feature flags (local/CI)ftrConfig attribute in spec fileCustom server configuration for stateless environments
Feature flags (MKI/cloud)Limited — often requires @skipInServerlessMKIKibana Core APIs

Key Behavioral Differences

  1. Spec isolation: Cypress creates a clean environment per spec file. Scout shares the environment — you must manage state explicitly.

  2. Auto-waiting: Cypress retries commands with built-in timeout. Playwright/Scout also auto-waits on locator actions but uses different mechanisms (expect.poll(), locator assertions).

  3. Async model: Cypress chains commands in a queue. Scout/Playwright uses async/await — more predictable control flow.

  4. Browser context: In Scout, each test() block spins up a new browser context. Use test.step() for multi-step flows to reuse context and improve execution time.

  5. Setup/teardown: Cypress often uses UI for setup. Scout strongly prefers API-based setup via apiServices/kbnClient.