Skip to content

Conversation

@nirajacharya2
Copy link
Contributor

@nirajacharya2 nirajacharya2 commented Apr 11, 2025

Description

With this PR, we can run selective tests using predefined users.

Tests that cannot be run (at least for now):

  • admin action tests:
    • admin-settings
    • role assignment
    • any admin actions
  • group tests

What happens when using predefined users?

  • admin user will not create any users during the test
  • after each scenario, user resources and settings will be reverted without trying to delete the user.

How to Run Tests

Available configs:

  • PREDEFINED_USERS: (true|false)
  • PREDEFINED_USERS_FILE: (path to a JSON file mapping predefined users)

Predefined users JSON file example:

Important

The user keys MUST be the defined ones only
Available keys:

{
 "alice": {//map user}, ❗MANDATORY
 "brian": {//map user}, ❗MANDATORY
 "carol": {//map user}, ❗MANDATORY
 "david": {//map user},
 "edith": {//map user},
 "max": {//map user},
}

Required user properties:

{
 "id": "<usernmae>",
 "displayName": "<display-name>",
 "password": "<password>",
 "email": "<email>"
}

Example mapping:

{
  "alice": {
    "id": "einstein",
    "displayName": "Albert Einstein",
    "password": "relativity",
    "email": "einstein@example.org"
  },
  "brian": {
    "id": "marie",
    "displayName": "Marie Skłodowska Curie",
    "password": "radioactivity",
    "email": "marie@example.org"
  },
  "carol": {
    "id": "moss",
    "displayName": "Maurice Moss",
    "password": "vista",
    "email": "moss@example.org"
  }
}

Note

Only the test scenarios tagged with @predefined-users work with predefined users.

Command:

PREDEFINED_USERS=true \
PREDEFINED_USERS_FILE='./users.json' \
pnpm test:e2e:cucumber tests/e2e/cucumber/features/smoke/upload.feature:63 --tags '@predefined-users'

Related Issue

Motivation and Context

To be able to run webUI e2e tests with pre-production servers

How Has This Been Tested?

  • test environment: 🖥️

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests
  • Documentation
  • Maintenance (e.g. dependency updates or tooling)

@saw-jan saw-jan self-assigned this Apr 15, 2025
@saw-jan saw-jan force-pushed the run-test-with-existing-user branch 5 times, most recently from 3808b77 to a5c0e81 Compare April 17, 2025 05:10
@saw-jan saw-jan changed the title [tests-only][full-ci]use external users for running tests [tests-only][full-ci] use predefined users with web e2e tests Apr 17, 2025
@saw-jan saw-jan marked this pull request as ready for review April 17, 2025 06:55
@saw-jan saw-jan force-pushed the run-test-with-existing-user branch from b16feee to ff894e1 Compare April 25, 2025 03:56
@saw-jan saw-jan self-requested a review April 25, 2025 03:57
Copy link
Member

@deyankiteworks deyankiteworks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work and LGTM.

nirajacharya2 and others added 11 commits April 28, 2025 09:50
Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
@saw-jan saw-jan force-pushed the run-test-with-existing-user branch from ff894e1 to f48288b Compare April 28, 2025 04:05
@sonarqubecloud
Copy link

@saw-jan saw-jan merged commit 6d4dc74 into master Apr 28, 2025
4 checks passed
@saw-jan saw-jan deleted the run-test-with-existing-user branch April 28, 2025 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants