steps.api.cloud
Classes
Cloud class for managing cloud resources during testing. |
Module Contents
- class steps.api.cloud.Cloud(users_path: str, config: dict, context: steps.api.utils.CloudContextHandler)[source]
Cloud class for managing cloud resources during testing.
This class provides functionality for initializing test resources, managing users, platforms and jobs for QA automation.
- Parameters:
users_path – Path to the CSV file containing user information
config – Configuration dictionary with environment variables
context – CloudContextHandler instance for making API requests
- admin_initialise(context: steps.api.utils.CloudContextHandler)[source]
Initialize the admin user with necessary tokens.
Logs in as admin, finds admin’s user ID, removes existing job tokens, and creates new tokens for test execution.
- Parameters:
context – CloudContextHandler instance for making API requests
- initialise(context: steps.api.utils.CloudContextHandler)[source]
Initialize the complete test environment.
Sets up admin, clears previous test data, creates test platforms and users, and creates a simple job for testing.
- Parameters:
context – CloudContextHandler instance for making API requests
- create_platform(context: steps.api.utils.CloudContextHandler)[source]
Create a default test platform for testing.
Creates and registers a platform with the default QA name and assigns it to the company if not in light version mode.
- Parameters:
context – CloudContextHandler instance for making API requests
- delete_platforms(context: steps.api.utils.CloudContextHandler)[source]
Delete all QA test platforms.
Removes all platforms with names containing “:qa” to clean up test resources.
- Parameters:
context – CloudContextHandler instance for making API requests
- load_users(users_path: str, context: steps.api.utils.CloudContextHandler)[source]
Load user information from a CSV file.
Reads user data from the CSV file, creates User objects with generated email and password data, and adds them to the users list.
- Parameters:
users_path – Path to the CSV file containing user information
context – CloudContextHandler instance for context information
- delete_users(context)[source]
Delete test users from the cloud system.
Finds and deletes all users from the cloud system that match the test users loaded from the CSV file.
- Parameters:
context – CloudContextHandler instance for making API requests
- create_users(context)[source]
Create test users in the cloud system.
Creates users in the cloud, assigns them to the default platform, logs them in, creates job tokens, and assigns tokens to the platform.
- Parameters:
context – CloudContextHandler instance with users_nb_to_create setting
- clear(context: steps.api.utils.CloudContextHandler)[source]
Clear existing test resources from the cloud system.
Removes all test users and platforms to ensure a clean environment.
- Parameters:
context – CloudContextHandler instance for making API requests