Skip to content

mcello23/cypress-demonstration-repo

Repository files navigation

IDENTITY PLATFORM BUILDER QA

Automate, Validate, Excel: Testing Made Effortless

Nightly Tests E2E Report Link


Table of Contents


Overview

The Identity Platform Builder QA project streamlines end-to-end testing for Builder's QA repository. It automates nightly regression tests, Docker setup, and GitHub Actions for consistent testing. With features like custom commands for API interactions and robust test coverage, it ensures a reliable and efficient testing environment for seamless project development. Targeted at QA teams and developers seeking streamlined testing workflows.


Features

Feature Summary
⚙️ Architecture
  • Modular architecture with clear separation of concerns.
  • Microservices-based design for scalability.
  • Utilizes central services clients API for integration.
🔩 Code Quality
  • Follows best practices with consistent coding standards.
  • Includes linting with ESLint and Prettier.
  • Uses testing frameworks like Mocha and Cypress for quality assurance.
📄 Documentation
  • Comprehensive documentation in JavaScript with a mix of JSON and YAML files.
  • Includes detailed feature files for behavior-driven development.
  • Package management with Yarn is well-documented.
🔌 Integrations
  • Integrates with GitHub Actions for CI/CD.
  • Utilizes Docker for containerization.
  • Includes various JSON files for configuration and data exchange.
🧩 Modularity
  • Highly modular structure with separate modules for different functionalities.
  • Encourages reusability and maintainability.
  • Follows a component-based approach for building.
🧪 Testing
  • Extensive testing coverage with unit tests and end-to-end tests using Cypress.
  • Includes test scripts for different scenarios and workflows.
  • Uses Mocha for test execution and reporting.
⚡️ Performance
  • Optimized performance with efficient code implementation.
  • Utilizes ESBuild for fast bundling and transpilation.
  • Includes performance testing scenarios for benchmarking.
🛡️ Security
  • Prioritizes security with secure coding practices.
  • Includes security-related linting rules.
  • Follows best practices for data handling and authentication.
📦 Dependencies
  • Manages dependencies using Yarn with lock files for version control.
  • Includes a wide range of dependencies for testing, linting, and development.
  • Ensures dependency updates for security and stability.

Project Structure

└── identity-platform-builder-qa/
    ├── .github
    │   ├── actions
    │   └── workflows
    ├── Dockerfile
    ├── README.md
    ├── cypress
    │   ├── e2e
    │   ├── fixtures
    │   ├── plugins
    │   └── support
    ├── cypress.config.js
    ├── cypress.env.example.json
    ├── package.json
    └── yarn.lock

Project Index

IDENTITY-PLATFORM-BUILDER-QA/
__root__
package.json - Facilitates running and managing Cypress tests for the QA repository of Builder
- Includes scripts for cleaning screenshots, running tests, generating reports, and more
- Dependencies cover testing tools like Mocha and ESLint plugins
- The file also configures Cypress plugins and preprocessor for Cucumber tests.
cypress.config.js - Configures Cypress test settings, including viewport dimensions, timeouts, project ID, screenshot and video settings, reporter options, and memory management
- Defines E2E test configurations such as base URL, setup events, and spec pattern for running Cucumber features
- Integrates plugins for high-resolution screenshots, collecting failing tests, and generating Mochawesome reports.
cypress.env.example.json Define environment variables for API and Hasura configurations in the project.
Dockerfile - Facilitates setting up a Docker environment for running Cypress E2E tests
- Installs necessary dependencies, configures Chrome, and sets up the project for testing
- Streamlines the process of running Cypress tests in a consistent and isolated environment.
.github
workflows
nightly-tests.yml - Automates nightly end-to-end regression tests for the project
- Checks code, installs dependencies, runs tests, uploads artifacts, deploys reports to GitHub Pages, and sends email notifications upon completion.
test-local.yml - Orchestrates end-to-end regression tests on push and pull requests for the project's master branch
- Utilizes GitHub Actions to set up Node.js, cache dependencies, run tests in a staging environment, and deploy reports to GitHub Pages
- Ensures continuous testing and reporting for code changes.
test-docker.yml - Automates end-to-end regression testing on Docker images
- Sets up Node.js, installs dependencies, builds Docker image, runs Cypress tests, and uploads artifacts
- Facilitates seamless testing and deployment workflows for the project.
actions
install
action.yml Facilitates caching and installing dependencies for the project using GitHub Actions.
testing-cypress
action.yml - Enables Cypress testing with required environment variables and dependencies setup
- Integrates with GitHub Actions for automated testing.
cypress
plugins
index.js - Configures language settings for different browsers before launching in the Cypress test environment
- Integrates the Cypress-Cucumber preprocessor to handle feature files.
support
api_builder_commands.js - The code file `api_builder_commands.js` provides Cypress commands to interact with the API for clearing user and client databases, as well as returning specific tag information
- These commands facilitate automated testing by handling database cleanup and data retrieval operations, ensuring a clean and predictable testing environment.
puppeteer.js - Automate browser interactions using Puppeteer to launch a headless browser, navigate to a specific URL, and manipulate video elements
- This code file enhances testing capabilities by simulating user behavior on web pages within the project's testing framework.
repeat_test.js - The code in `repeat_test.js` iterates through Cypress tests multiple times to ensure robustness
- It executes tests sequentially, handling errors and providing feedback for each iteration
- This script enhances test reliability by running the tests repeatedly, aiding in identifying intermittent failures and improving overall test coverage.
e2e.js - Integrates custom commands and test setup for end-to-end testing using Cypress
- Registers Mochawesome reporter, injects custom styles, clears user database before and after tests, captures screenshots, and ensures visibility of elements
- Enhances test automation and reporting capabilities for a robust testing framework.
gui_commands.js - Enables custom commands for user authentication, SDK creation, and camera stubbing in the Cypress test suite
- Facilitates seamless testing of user roles, SDK configurations, and camera functionalities within the project's end-to-end testing framework.
api_centralservices_commands.js - The code file `cypress/support/api_centralservices_commands.js` contains Cypress custom commands for interacting with the Central Services API
- These commands enable the removal of a specific client and the retrieval of client information from the API
- This file plays a crucial role in facilitating automated testing of the Central Services API within the project's testing framework.
api_mobile_sdk_creations.js Enables creation of mobile SDK instances with various configurations and statuses via API requests to facilitate testing and development workflows within the project architecture.
api_landing_commands.js - Implement Cypress custom commands for API testing unique URLs with different time parameters
- The commands send POST requests to specific endpoints, validate responses, and perform additional checks based on the time parameter provided
- The code enhances API testing capabilities within the project's test suite.
api_landing_creations.js - Summary: The code file `cypress/support/api_landing_creations.js` provides a Cypress custom command `api_createLandingEmpty` to programmatically create a new empty landing page via an API request
- This functionality allows for automated testing of landing page creation workflows within the project's testing suite.
fixtures
camera_stub
camera_stub.json Defines a camera stub JSON file for onboarding events, including session and tenant IDs, event details, and payload information.
manual_validations
landings.json Provide data for manual validations of various landing pages in the project.
landing_workflows.json - The code file `landing_workflows.json` in the `cypress/fixtures/manual_validations` directory defines the initial workflow for the landing page
- It specifies the actions and configurations for the START node, setting the foundation for the user journey within the application
- This file plays a crucial role in orchestrating the user interactions and guiding the flow of the landing page experience in the overall project architecture.
media.json - Provides sample media data for manual validations, containing details like name, creation/update timestamps, unique IDs, and associated user IDs
- This data is crucial for testing and verifying manual validation processes within the project architecture.
landing_configurations.json - Defines landing configurations for various onboarding processes, including titles, API keys, and creation dates
- Captures settings like video recording and callback URLs
- Supports customization for different onboarding scenarios within the project.
landing_themes.json - Define manual validations for landing themes in the JSON file, capturing primary, secondary, and tertiary colors, along with font and logo IDs
- Each theme entry includes creation and update timestamps, reflecting user-specific configurations.
landing_modules.json - The code file `landing_modules.json` in the `cypress/fixtures/manual_validations` directory contains configurations for landing modules, including details such as the callback URL and whether the module is active or valid
- This file serves as a reference for setting up manual validations related to landing modules within the project architecture.
auto_validations
landings.json Provides sample data for auto validations of various landing pages within the project architecture.
landing_workflows.json - The code file `landing_workflows.json` in the `cypress/fixtures/auto_validations` directory defines the initial workflow for the landing page
- It specifies the actions and configurations for the START widget, setting the foundation for the user journey within the application
- This file plays a crucial role in orchestrating the user experience flow and interactions on the landing page within the project's architecture.
media.json - Provides sample media data for auto-validations in the project, containing details like name, creation/update timestamps, ID, and user ID
- This data is crucial for testing and ensuring the accuracy of automated validation processes within the project architecture.
landing_configurations.json Define landing configurations for onboarding processes with various titles, URLs, and API keys.
landing_themes.json Define landing page themes with customizable colors and assets for user personalization.
landing_modules.json - Define landing modules with active and valid states, containing specific values for client, tenant, and platform version
- Each module has unique identifiers and timestamps
- These modules are associated with different landing pages and users within the project architecture.
e2e
cucumber
06 - Validation of SDK and Landing CRUDs with Happy Paths.feature - Validate customization and connection of Landings and SDKs via API and UI, ensuring successful saves
- Manually configure URLs, customize colors, and connect SDKs, verifying properties like Automatic and Tracking
- Confirm correct display of status variations for Landings and SDKs.
09 - Validation of Landing Unique URL and Time Validity.feature Validate Landing API for URL uniqueness and time validity based on different expiration times.
07 - Validation of SDK CRUD Flows with Widgets with Mandatory Configuration.feature - Validates CRUD operations for SDK widgets with mandatory configuration via UI and API
- Covers creating, updating, and deleting flows, ensuring data integrity across both levels.
10 - Validation of Builder CRUDs with Buttons and Widgets enabled through Central Services Clients API.feature - Validates Builder services by enabling buttons and widgets through Central Services API, ensuring proper functionality on UI and API calls
- Tests scenarios for different button and widget configurations, confirming correct behavior and API interactions.
05 - Validation of SDK customization and CRUDs.feature - Validate CRUD operations and SDK customizations via API and UI, ensuring color options, button roundness, and dark themes are correctly displayed and saved
- The scenarios cover editing, previewing, creating, updating, and saving SDK customizations, with validations through both UI and API.
01 - Builder and Landing Basic Functionalities.feature Validate various user interactions and functionalities in Builder, including login/logout, tutorial flows, landing and SDK buttons, tag selection, search field behavior, Design Studio display, SDK version validation, and owner/user role permissions.
03 - Validation of Landing Community Templates.feature - Validate and play various landing templates through UI and API, ensuring specific properties are met
- This feature focuses on creating, playing, and verifying different types of landings like Onboarding, Forms, and Video Contracting
- It ensures seamless user interactions with the platform's diverse landing templates.
04 - Validation of Landing Actions and other Regressions.feature - Validate Landing Actions and Regressions through UI and API
- Includes scenarios for QR code testing, Query Selector validation, and actions like Publish, Unpublish, Duplicate, and Delete
- Also covers bug fixes for SelphID country arrays
- This file ensures comprehensive testing and validation of various landing page functionalities.
08 - Validation of Tags associated with Landings and SDKs.feature - Facilitates validation of tags for mobile SDKs and Landings via API and UI
- Allows users to search, add, and remove tags, validating changes through both interfaces
- Enhances user experience by ensuring seamless tag management within the Builder platform.
02 - Design Studio basics and CRUDs.feature - Validates Builder and SDK user flows by testing Design Studio widgets creation, updates, and validations via API and UI
- Covers scenarios for creating and viewing Landing and SDK flows, ensuring successful creation and validation
- Deletes occur at the API level post-test.
08 - Validation of Tags associated with Landings and SDKs
08 - Validation of Tags associated with Landings and SDKs.js - Validates tags associated with Landings and SDKs by performing login, searching, adding, and removing tags
- Verifies tag presence through UI and API, ensuring proper functionality and visibility
- Supports testing and validation of tag-related features within the project's end-to-end testing suite.
06 - Validation of SDK and Landing CRUDs with Happy Paths
06 - Validation of SDK and Landing CRUDs with Happy Paths.js - Summary: The provided code file implements end-to-end tests using Cypress and Cucumber for validating SDK and Landing CRUD operations with happy paths in the project's architecture
- It leverages predefined steps for login and flow creation, ensuring smooth execution and verification of key functionalities
- The file enhances the project's testing suite by automating scenario validations and maintaining test context for comprehensive testing coverage.
02 - Design Studio basics and CRUDs
02 - Design Studio basics and CRUDs.js - Facilitates end-to-end testing of Design Studio functionalities by simulating user interactions to create various types of flows with widgets
- Validates successful creation and customization of flows via UI and API
- Ensures proper functionality and integration of SDK widgets for Android and iOS platforms
- Maintains a structured approach to testing and verifying key features within the Design Studio environment.
09 - Validation of Landing Unique URL and Time Validity
09 - Validation of Landing Unique URL and Time Validity.js - Implements validation of landing URL uniqueness and time validity by interacting with Hasura database and executing API calls
- Handles insertion of various data fixtures and test context management
- Supports testing scenarios for Builder login and different time validity checks.
07 - Validation of SDK CRUD Flows with Widgets with Mandatory Configuration
07 - Validation of SDK CRUD Flows with Widgets with Mandatory Configuration.js - Validate and create SDK flows with widgets, ensuring mandatory configurations are set
- Login to Builder, select widgets, fill mandatory fields, save the flow, and validate through UI and API
- Delete flows, confirm deletion, and save flows
- This code file orchestrates end-to-end testing of SDK CRUD flows with widgets and mandatory configurations, crucial for maintaining application integrity.
10 - Validation of Builder CRUDs with Buttons and Widgets enabled through Central Services Clients API
10 - Validation of Builder CRUDs with Buttons and Widgets enabled through Central Services Clients API.js - The provided code file is responsible for validating Builder CRUD operations with buttons and widgets enabled through the Central Services Clients API in an end-to-end testing scenario using Cypress and Cucumber
- It sets up test steps for logging in with a user having 'Mobile SDK Android' enabled on Central Services and verifies the presence of specific buttons on the homepage while validating API calls
- The file ensures the smooth execution of these test cases within the project's testing framework.
05 - Validation of SDK customization and CRUDs
05 - Validation of SDK customization and CRUDs.js - Validate SDK customization and CRUD operations through UI and API calls
- The code file orchestrates login, color customization, theme mode toggling, and flow updates in the Builder platform
- It ensures seamless validation of SDK features and interactions, reflecting changes visually and confirming them via API responses.
03 - Validation of Landing Community Templates
03 - Validation of Landing Community Templates.js - Validate and insert various configurations, workflows, media, themes, modules, and landings into Hasura before and after each test scenario
- Implement login and specific property checks for different types of landing pages via API calls
- This file sets up and verifies landing page properties for different scenarios in the project's end-to-end testing suite.
04 - Validation of Landing Actions and other Regressions
04 - Validation of Landing Actions and other Regressions.js - The code file validates and interacts with various landing configurations, workflows, media, themes, modules, and URLs through API calls
- It covers actions like creating, publishing, duplicating, and deleting landing pages, ensuring UI and API responses align
- Additionally, it includes regression tests for specific scenarios related to dropdown countries and HTML code properties.
01 - Builder and Landing Basic Functionalities
01 - Builder and Landing Basic Functionalities.js - The provided code file in the project's Cypress test suite focuses on testing the basic functionalities of the Builder and Landing pages using Cucumber syntax
- It defines test steps for actions like opening the login page, entering valid credentials, and verifying successful login in both the UI and API
- The file contributes to ensuring the functionality and user experience of the Builder and Landing pages are working as expected within the project's test automation framework.

Getting Started

Prerequisites

Before getting started with identity-platform-builder-qa, ensure your runtime environment meets the following requirements:

  • Programming Language: JavaScript
  • Package Manager: Yarn
  • Container Runtime: Docker

Installation

Install identity-platform-builder-qa using one of the following methods:

Build from source:

  1. Clone the identity-platform-builder-qa repository:
❯ git clone https://github.com/facephi/identity-platform-builder-qa.git
  1. Navigate to the project directory:
cd identity-platform-builder-qa
  1. Install the project dependencies:

Using yarn  

❯ yarn

Using docker  

❯ docker build -t facephi/identity-platform-builder-qa .

Usage

Run identity-platform-builder-qa using the following command:

Using yarn  

❯ yarn cy run

Using docker  

❯ docker run -it {image_name}

Testing in GUI

Run the test suite using the following command:

Using yarn  

❯ yarn co

Contributing

Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your github account.
  2. Clone Locally: Clone the forked repository to your local machine using a git client.
    git clone https://github.com/facephi/identity-platform-builder-qa
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear message describing your updates.
    git commit -m 'Implemented new feature x.'
  6. Push to github: Push the changes to your forked repository.
    git push origin new-feature-x
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
  8. Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!

License

This project is protected under the MIT License. For more details, refer to the LICENSE file.


Acknowledgments

  • Ask me for the cypress.env.json file that's not versioned through Keeper.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •