Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test/cypress #272

Open
wants to merge 84 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
9301d82
refactor: fe app panel
NikhilZelthy May 28, 2024
ceb75e4
build: v2.0.0
NikhilZelthy May 28, 2024
fb87904
test: init cypress
NikhilZelthy May 28, 2024
f9ef4ff
cypress locator addition
madhu-355 Jun 12, 2024
c893349
locators
madhu-355 Jun 12, 2024
eb508c2
locators
madhu-355 Jun 12, 2024
e5026a0
locators update
madhu-355 Jun 19, 2024
2143d9c
locators update 1
madhu-355 Jun 19, 2024
a17c89d
locator_updates
madhu-355 Jun 24, 2024
696b49a
build update
madhu-355 Jun 25, 2024
17f1b51
merge: main branch to test/cypress
madhu-355 Jun 25, 2024
d8e5f03
build: v2.0.1
madhu-355 Jun 25, 2024
e3b5587
locator updates
madhu-355 Jul 18, 2024
3355997
js update
madhu-355 Jul 18, 2024
c1eea8a
locator update
madhu-355 Jul 19, 2024
5a47663
locator updates
madhu-355 Jul 19, 2024
3a06d37
Merge branch 'main' of https://github.com/Healthlane-Technologies/Zan…
madhu-355 Jul 25, 2024
308cd3b
deleted unwanted-files
madhu-355 Jul 25, 2024
27d3e40
cypress tests added
madhu-355 Jul 26, 2024
86dfb04
moved cypress to root folder
madhu-355 Jul 26, 2024
6580aef
added github actions
madhu-355 Jul 29, 2024
8b0b9e2
test workflow
madhu-355 Jul 29, 2024
29c416b
test workflow update
madhu-355 Jul 29, 2024
cd050ca
test workflow update 1
madhu-355 Jul 29, 2024
065de30
test workflow update 2
madhu-355 Jul 29, 2024
1bb82d5
test workflow update 3
madhu-355 Jul 29, 2024
e14ffc7
test workflow update 4
madhu-355 Jul 29, 2024
c687dcf
test workflow update 5
madhu-355 Jul 29, 2024
194e90a
test workflow update 6
madhu-355 Jul 29, 2024
0a5bdc7
test workflow update 7
madhu-355 Jul 29, 2024
9e55d89
test workflow update 8
madhu-355 Jul 29, 2024
21a4675
Test Cypress Workflow
madhu-355 Jul 29, 2024
351252c
test workflow update 9
madhu-355 Jul 29, 2024
8c146d6
test workflow update 10
madhu-355 Jul 29, 2024
e52c5b0
test workflow update 11
madhu-355 Jul 29, 2024
bb1b8b9
Test Cypress Run
madhu-355 Jul 29, 2024
eec1d87
Added reports
madhu-355 Jul 29, 2024
be8fe36
Dev testing e2e
madhu-355 Jul 31, 2024
531f6e8
e2e test on dev
madhu-355 Jul 31, 2024
9f0dd94
e2e test on dev 1
madhu-355 Jul 31, 2024
cf5cfa3
e2e test on dev 2
madhu-355 Jul 31, 2024
3f0b796
e2e test on dev 3
madhu-355 Jul 31, 2024
96bb7b4
e2e test on dev 4
madhu-355 Jul 31, 2024
f84ddf6
e2e test on dev 6
madhu-355 Jul 31, 2024
ec7cd25
Report Addition
madhu-355 Jul 31, 2024
b22af22
Report Addition 1
madhu-355 Jul 31, 2024
7ce9441
Report Addition 2
madhu-355 Jul 31, 2024
5c219d7
Report Addition 3
madhu-355 Jul 31, 2024
7a90567
Report Addition 4
madhu-355 Jul 31, 2024
abf994c
Report Addition 5
madhu-355 Jul 31, 2024
143a037
Report Addition 6
madhu-355 Aug 1, 2024
8abb722
Report Addition 7
madhu-355 Aug 1, 2024
89c6938
Report Addition 8
madhu-355 Aug 1, 2024
6f9d3a2
Report Addition 9
madhu-355 Aug 1, 2024
4b20a9c
Report Addition 10
madhu-355 Aug 1, 2024
1f6087f
Report Addition 11
madhu-355 Aug 1, 2024
d41c6ce
e2e test
madhu-355 Aug 1, 2024
ff16e19
e2e test 1
madhu-355 Aug 1, 2024
d63b182
e2e test 2
madhu-355 Aug 1, 2024
cfbd568
e2e test 3
madhu-355 Aug 1, 2024
cf20af1
e2e test 4
madhu-355 Aug 1, 2024
9b284d2
e2e test 5
madhu-355 Aug 1, 2024
0f48bdd
e2e test 6
madhu-355 Aug 1, 2024
da958ab
e2e test 7
madhu-355 Aug 1, 2024
cea1d35
e2e test 8
madhu-355 Aug 1, 2024
a31be6a
e2e test 9
madhu-355 Aug 1, 2024
bb7ba11
e2e test 10
madhu-355 Aug 1, 2024
4572864
refactor: fe app panel
NikhilZelthy May 28, 2024
2fa346d
build: v2.0.0
NikhilZelthy May 28, 2024
68cf6b3
test: init cypress
NikhilZelthy May 28, 2024
9c93f4f
cypress locator addition
madhu-355 Jun 12, 2024
a390b8d
locators
madhu-355 Jun 12, 2024
5e40f00
locators
madhu-355 Jun 12, 2024
148af4c
merge with main
madhu-355 Aug 1, 2024
90e27c4
merged with main
madhu-355 Aug 1, 2024
cfdd76e
locators update 1
madhu-355 Jun 19, 2024
1d2c63f
locator_updates
madhu-355 Jun 24, 2024
fd5bcb4
build update
madhu-355 Jun 25, 2024
bac8d80
build: v2.0.1
madhu-355 Jun 25, 2024
53e218c
js update
madhu-355 Jul 18, 2024
c2fd8fc
merged with main
madhu-355 Aug 1, 2024
a35c153
merged with main 1
madhu-355 Aug 1, 2024
8021065
merged with main 2
madhu-355 Aug 1, 2024
5065d2d
New changes
madhu-355 Aug 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/e2e-cypress-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: End to End Cypress Test

on:
push:
branches:
- test/cypress
paths:
- "frontend/**"

jobs:
cypress-run:
runs-on: ubuntu-latest

steps:
# Step 1: Checkout the repository
- name: Checkout
uses: actions/checkout@v3

# Step 2: Set up Node.js environment
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18"

# Step 3: Install dependencies
- name: Install dependencies
run: npm install
working-directory: e2e-tests

# Step 4: List files in the working directory
- name: List files
run: ls -la
working-directory: e2e-tests

# Step 5: Run Cypress tests and record results
- name: Run Cypress tests
uses: cypress-io/[email protected]
with:
working-directory: e2e-tests
record: true
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
continue-on-error: true

# Step 6: Generate Cucumber HTML Report
- name: Generate Cucumber HTML Report
run: |
echo "Running cucumber-html-report.js"
ls -la
node cucumber-html-report.js
working-directory: e2e-tests

# Step 7: Upload Cypress screenshots on failure
- name: Upload Cypress screenshots
uses: actions/upload-artifact@v3
with:
name: cypress-screenshots
path: e2e-tests/cypress/screenshots
if-no-files-found: ignore

# Step 8: Upload Cypress videos
- name: Upload Cypress videos
uses: actions/upload-artifact@v3
with:
name: cypress-videos
path: e2e-tests/cypress/videos
if-no-files-found: ignore

# Step 9: Upload Cucumber HTML Report
- name: Upload Cucumber HTML Report
uses: actions/upload-artifact@v3
with:
name: cucumber-html-report
path: e2e-tests/reports/cucumber-html-report.html
if-no-files-found: ignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
var csrf_token = "{{ csrf_token }}";
var platform_version = "{{ platform_version }}";
</script>
<script src="{% static 'app_panel/js/build.*.min.js'|use_latest %}"></script>
<script src="{% static 'app_panel/js/build.v2.0.4.min.js' %}"></script>
<script src="{% static 'js/jquery/3.7.1/jquery.min.js' %}"></script>
{% include 'session_security/all.html' %}
</body>
Expand Down
2 changes: 2 additions & 0 deletions backend/src/zango/assets/app_panel/js/build.v2.0.4.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions backend/src/zango/assets/app_panel/js/build.v2.0.5.min.js

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions e2e-tests/cucumber-html-report.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const report = require("multiple-cucumber-html-reporter");

report.generate({
jsonDir: "./cypress/cucumber-json",
reportPath: "./reports/cucumber-html-report.html",
metadata: {
browser: {
name: "chrome",
version: "126",
},
device: "MacBook Air",
platform: {
name: "Mac OS",
version: "Sonoma 14.2",
},
},
customData: {
title: "Run info",
data: [
{ label: "Project", value: "Zango e2e Tests" },
{ label: "Release", value: "Phase 1" },
{ label: "Cycle", value: "A1" },
{ label: "Execution Start Time", value: new Date().getTime() },
{ label: "Execution End Time", value: new Date().getTime() },
],
},
});
23 changes: 23 additions & 0 deletions e2e-tests/cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const cucumber = require("cypress-cucumber-preprocessor").default;

const { defineConfig } = require("cypress");

module.exports = defineConfig({
projectId: "49hfyd",
chromeWebSecurity: false,
reporterOptions: {
reportDir: "e2e-tests/reports",
charts: true,
reportPageTitle: "Zango",
embeddedScreenshots: true,
},
e2e: {
experimentalRunAllSpecs: true,
setupNodeEvents(on, config) {
on("file:preprocessor", cucumber());
},
// specPattern: "**/*.feature",
specPattern: "cypress/e2e/**/*.feature",
// specPattern: "cypress/e2e/**/*.cy.{js,jsx,ts,tsx}",
},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Feature: App Launch and Validation
Background: Navigate to the home page of App Panel
Given Admin logins successfully and lands on the home page of App panel

Scenario: App Launch with valid data
When Admin clicks on the app launch button on homepage
And Admin fills the app launch form with the valid data and submits the form
Then App should be successfully Launched and also the Api response should have message "App Launch Initiated Successfully" and status code 200


Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Feature: App update and Validation
Background: Navigate to the details view of App
Given Admin logins successfully and lands on the details view of App

Scenario: Api assertion post landing on app details view
When Validate the app configuration URL
Then Api response post landing on the app configuration should have same app name and app uuid

Scenario: Update app details with valid data
When Admin clicks on the update details button in the app details view
And App update form should be displayed with the following fields
| field_name_1 | field_name_2 | field_name_3 | field_name_4 | field_name_5 | field_name_6 | field_name_7 | field_name_8 |
| App Name | Description | Upload Logo | Upload Fav Icon | Domain | Time Zone | Date Format | Date Time Format |
And Admin fills the app details form with the valid data and submits the form
Then App details should be successfully updated and also the Api response should have message "App Settings Updated Successfully" and status code 200
When Admin lands back on the details view
Then App details should be updated as expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Feature: User Role Creation and Validation
Background: Navigates to the user role tab
Given Admin navigates to the user role tab and gets the user role data from fixture data

Scenario: User role creation with valid data
When Admin clicks on the new user role button on the user role page
And Admin creates dynamic data for user role creation
And Add user role form is displayed with the following fields
| field_name_1 | field_name_2 |
| Role Name | Policy |
And Admin fills up the user role form with the valid data and submits the form
Then User role should be successfully added and admin should be redirected to the table view
And Admin also wants to assert the Api response post user role addition
Then Api response post user role creation should have message "User Role Created Successfully" and status code 200

Scenario: Required fields validation for user role form
When Admin clicks on the new user role button on the user role page
And Admin skips the mandatory fields
Then Required field error message for user role form should be displayed

Scenario: User role creation with existing role name
When Admin clicks on the new user role button on the user role page
And Admin fills up the user role form with the valid data and submits the form
Then Error message for duplication of user role should be displayed

Scenario: User role update with existing role name
When Admin clicks on the user role table search button and Enters the valid data
And Admin clicks on the edit user role button under the three dots menu
And Admin fills up the edit user role form with the existing data and submits the form
Then Error message for duplication of user role should be displayed

Scenario: Table data validation post user role creation
When Validate the user role tab URL
And User role table should contain the following columns
| Column_1 | Column_2 | Column_3 | Column_4 |
| Role | Policy(s) | Active/Inactive | No. of Users |
And Admin clicks on the user role table search button and Enters the valid data
Then User role table row should contain the valid data

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Feature: User role api assertions

Background: Navigates to the user role tab
Given Admin navigates to the user role tab and gets the user role data from fixture data

Scenario: Api assertion post landing on user role tab
When Admin lands on the user role tab
Then Api response post landing on user role tab should have message "All roles fetched successfully" and status code 200

Scenario: Api assertion post search
When Admin clicks on the user role table search button and Enters the valid data
Then Api response post search should have message "All roles fetched successfully" total records should be 1 and status code 200 in user role table

Scenario: Api assertion for deactivating the user role
When Admin clicks on the user role table search button and Enters the valid data
And Admin clicks on the deactivate user role button under the three dots menu
And Api response post update of the user role should have message "User Role Updated Successfully" and status code 200
Then Post deactivation user role should get deactivated

Scenario: Api assertion for activating the user role
When Admin clicks on the user role table search button and Enters the valid data
And Admin clicks on the activate user role button under the three dots menu
And Api response post update of the user role should have message "User Role Updated Successfully" and status code 200
Then Post activation user role should get activated

Scenario: Admin wants to update the user role and also assert the api response
When Admin clicks on the user role table search button and Enters the valid data
And Admin clicks on the edit user role button under the three dots menu
And Admin updates the user role form with the valid data
Then Api response post update of the user role should have message "User Role Updated Successfully" and status code 200
30 changes: 30 additions & 0 deletions e2e-tests/cypress/e2e/featureFiles/3_userFeature/user.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Feature: User Creation and Validation
Background: Navigates to the user tab
Given Admin navigates to the user tab and gets the user data from fixture data

Scenario: user creation with valid data
When Admin clicks on the new user button on the user page
And Admin creates the dynamic data of the user creation
And Add user form is dispalyed with the following fields
| field_name_1 | field_name_2 | field_name_3 | field_name_4 | field_name_5 |
| Full Name | Email | Mobile | Password | User Role |
And Admin fills up the user form with valid data and submits the form
Then User should be successfully addded and admin should be redirected to the table view
And Admin also wants to assert the Api response post user addition
Then Api response post user creation should have message "App User created successfully." and status code 200
Scenario: Required fields validation for user form
When Admin clicks on the new user button on the user page
And Admin skips the mandatory fields on user form
Then Required field error message for user from should be displayed
Scenario: User creation with existing role name
When Admin clicks on the new user button on the user page
And Admin fills up the user form with valid data and submits the form
Then Error message for duplication of user should be displayed

Scenario: Table data validation post user role creation
When Validate the user tab URL
And User table should contain the following columns
| Column_1 | Column_2 | Column_3 | Column_4 | Column_5 | Column_6 | Column_7 |
| User Id | User Name Active/inactive | Mobile | Email | Management Access | Last Login / Date Joined | Password Change date |
And Admin clicks on the user table search button and Enters the valid data
Then User table row should contain the valid data
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Feature: User Api Assertion
Background: Navigates to the user tab
Given Admin navigates to the user tab and gets the user data from fixture data

Scenario: Admin wants to update the user role and also assert the api response
When Admin clicks on the user role table search button and Enters the valid data "Test Sanity6"
And Admin clicks on the edit user role button under the three dots menu
And Admin updates the user role form with the following data
| role_name | Policy |
| Test Sanity7 |
Then Api response post update should have message "User Role Updated Successfully" and status code 200
Scenario: Admin wants to deactivate the user role
When Admin clicks on the user role table search button and Enters the valid data "Test 108"
And Admin clicks on the deactivate user role button under the three dots menu
And Api response post update should have message "User Role Updated Successfully" and status code 200
Then Post deactivation user role should get deactivated
Scenario: Admin wants to activate the user role
When Admin clicks on the user role table search button and Enters the valid data "Test 108"
And Admin clicks on the activate user role button under the three dots menu
And Api response post update should have message "User Role Updated Successfully" and status code 200
Then Post activation user role should get activated
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Feature: Policy Management
Background: Navigate to the Policies Tab
Given User navigates to policies tab
Scenario: Admin wants to verify that all the policies are loaded
When Validate the policies tab URL
And Policy table should contain the following columns
| Column_1 | Column_2 | Column_3 | Column_4 | Column_5 |
| Policy Id | Policy Name | Configuration | Description | Roles |
Then Api response post landing on policies tab should have message "All policies fetched successfully" and status code 200

Scenario: Admin wants to sync the policies
When Admin clicks on the sync policy button
Then Api response post syncing policies should have message "Policies synced successfully" and status code 200
13 changes: 13 additions & 0 deletions e2e-tests/cypress/e2e/featureFiles/5_taskFeature/task.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Feature: Task Management
Background: Navigate to the Task Tab
Given User navigates to task tab
@focus
Scenario: Admin wants to sync the tasks
When Admin clicks on the sync task button
Then Api response post syncing tasks should have message "Tasks synced successfully" and status code 200
Scenario: Admin wants to verify that all the tasks are loaded
When Validate the task tab URL
And Task table should contain the following columns
| Column_1 | Column_2 | Column_3 | Column_4 | Column_5 |
| Task Id | Task Name | Policy | Schedule (UTC) | Status |
Then Api response post landing on tasks tab should have message "All app tasks fetched successfully" and status code 200
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Feature: Package Management
Background: Navigate to the Package Tab
Given User navigates to Package tab
@focus
Scenario: Admin wants to verify the contents of package tab
When Validate the Package tab URL
And Package table should contain the following columns
| Column_1 | Column_2 | Column_3 | Column_4 |
| Package Name | Version | Status | Status |
Then Api response post landing on Package tab should have status code 200

# Scenario Outline:Admin wants to install the packages
# When Admin clicks on the package table search button and Enters the "<packages>"
# And Admin clicks on the install package button under the three dots menu
# And Install package form should contain following fields
# | field_name_1 | field_name_2 |
# | Package Name | Version |
# And Admin selects the version and submits the form
# Then Api response post installation should have message "Package Installed" and status code 200

# Examples:
# | packages |
# | communication |
# | crud |
# | frame |
# | login |
# | workflow |
Loading
Loading