🖌️
Product Process Documentation
  • Product Process Documentation
  • Definition of Done (DoD)
    • General checkpoints
      • Specific checkpoints by team
    • Important process: QA review & PO review
      • QA Review
      • PO Review
  • Work Items
    • Product Backlog Item (PBI)
    • Bug
      • Basic rules for creating a bug
      • How to report a Bug
    • Bugs Management
  • Code Standards
  • Different Test Levels
    • Unit Test
      • Frontend Unit Testing
        • What is a Unit Test?
        • How do I know if I am developing a good unit test?
        • AAA (Arrange, Act and Assert)
        • Overloaded test suits
        • Setup & Teardown
          • JEST Mocks
          • FakeTimers
        • Istanbul Annotations
        • C8 Annotations
        • JEST Runner (Debug unit tests with Jest)
    • Component Test
      • Frontend Component Testing
        • What is Component Testing?
        • Best practices
        • Bad practices
        • Setup
          • Sandbox
          • Mocks, Services and Providers
          • Test scenario
    • Integration Test
      • Frontend Integration Testing
        • What is a Integration Test?
        • AAA (Arrange, Act and Assert)
        • Best Practices
        • Bad practices
        • Setup & Teardown
        • How to create a scenario
          • Create the migrated app
          • Add to project
        • How to debug
        • Common problems
      • Testing Driven Development Guide and recommendations
    • Functional Test
    • Security Testing
      • Security Testing Tools
      • Frontend Security Testing
    • Performance testing
    • Best Practices
    • Test Documentation
  • Run test projects
    • General steps
    • Specific steps by team
  • DevOps
    • Pipelines
    • Builds
    • Specific information by team
    • Test plan
    • Service Hooks for Azure DevOps Notifications
      • Slack Notifications
      • Microsoft Teams Notifications
  • Dashboards
    • General
    • QA Dashboards
  • Release Process
    • General Steps
    • Specific steps by team
  • Migration Cells
    • Basics of testing process
  • Release process
  • References
Powered by GitBook
On this page
  • Add Cypress Command to open component sandbox:
  • Add spec file and component commands for selectors:
  • Cypress run options

Was this helpful?

  1. Different Test Levels
  2. Component Test
  3. Frontend Component Testing
  4. Setup

Test scenario

PreviousMocks, Services and ProvidersNextIntegration Test

Last updated 2 years ago

Was this helpful?

The environment is ready to start testing! We use Cypress for component testing so, to mount the scenario follow the next steps:

Add Cypress Command to open component sandbox:

Since our component is mounted and isolated by the angular playground server, we need to access this space with Cypress before starting the test cases. Once accessed is enough, but this varies according to the needs of the test plan.m

Add spec file and component commands for selectors:

For reasons of order, the test files must be created in the Cypress component folder, inside this, create a folder with the name of the component to test.

Cypress run options

We have two options to run the tests in Cypress, the first is by opening the dashboard and selecting the test there. This is the preferred option since component tests have a focus on the interface from the perspective of the end user, because it must be verified that if what is happening is happening visually.

The second option is to run in the background, this option is mainly for the job that is responsible for executing the tests in the TFS pipeline. But if you need to do a quick test check, it's a good option to save some time.

If you want see Cypress UI Dashboard run:

npm run cy:open

To run test without browser:

npm run cy:test

We must also create the necessary commands to facilitate access to the playground and the selectors of the component elements, if you want to know more about Cypress, check .

Cypress Docs
You can get component sandbox URL from playground instance in the browser
Component test folder
Commands
Spec
You need cy:run, cy:opendashboard and playground scripts to run tests