https://github.com/daniel-grounin/cloudstoragecli-testing
Automated testing framework for Google Cloud Storage CLI commands using TestNG & Allure Reporting. Ensures smooth operations for bucket creation, file uploads, listing files, and signed URLs. π
https://github.com/daniel-grounin/cloudstoragecli-testing
allure-report automation gcloud maven testing testng
Last synced: about 2 months ago
JSON representation
Automated testing framework for Google Cloud Storage CLI commands using TestNG & Allure Reporting. Ensures smooth operations for bucket creation, file uploads, listing files, and signed URLs. π
- Host: GitHub
- URL: https://github.com/daniel-grounin/cloudstoragecli-testing
- Owner: Daniel-Grounin
- Created: 2025-02-25T21:14:07.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-26T14:27:32.000Z (over 1 year ago)
- Last Synced: 2025-02-26T15:33:27.188Z (over 1 year ago)
- Topics: allure-report, automation, gcloud, maven, testing, testng
- Language: Java
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# π Project Overview
This project automates and tests **Google Cloud Storage CLI** commands using **TestNG**, **Allure** for reporting, and **Playwright** for signed URL validation.
---
# Running the Project with Docker
This section provides step-by-step instructions on how to build and run the project using Docker.
## Steps to Run the Docker Container
1. **Build the Docker Image:**
```sh
docker build -t gcloud-tests .
```
2. **Run the Docker Container:**
```sh
docker run -it --rm gcloud-tests
```
This command will start the container and prompt you for authentication.
3. **Authenticate with Google Cloud:**
- When you run the container, you will see a terminal output similar to this:

- Copy and paste the provided URL into your browser to authenticate your account.
- Enter the verification code back into the terminal.
4. **Verify that the Project and Bucket are Created:**
- After authentication, the setup script will create the necessary Google Cloud project and storage bucket.
- You can verify this by running:
```sh
gcloud projects list
gcloud storage buckets list
```
5. **Expected Output:**
- After a successful setup, you should see output confirming the creation of the project and bucket
Now your Google Cloud project and bucket are ready for testing!
---
## π Features
β
**Automated tests for Google Cloud Storage CLI commands:**
- Create a bucket
- Upload a file
- List files in a bucket
- Generate a signed URL
π **Modular test framework** for easy expansion
π **Allure Reporting** for clear test execution insights
π **Maven-based project** for easy build & dependency management
---
## π Getting Started
### 1οΈβ£ Prerequisites
Make sure you have the following installed:
- **Java 21+** β
- **Maven** β
- **Google Cloud SDK** β
*(Ensure gcloud CLI is authenticated and configured)*
- **Allure CLI** β
*(For test reporting)*
---
### 2οΈβ£ Clone the Repository
```sh
git clone https://github.com/yourusername/CloudStorageCLI-Testing.git
cd CloudStorageCLI-Testing
```
---
### 3οΈβ£ Configure Project Settings
Edit `ProjectConfig.java` to match your GCP setup:
```java
public class ProjectConfig {
public static final String BUCKET_NAME = "your-bucket-name";
public static final String TEST_FILE_NAME = "test-file.txt";
public static final String G_CLOUD_PATH = "\"C:\\Program Files (x86)\\Google\\Cloud SDK\\google-cloud-sdk\\bin\\gcloud.cmd\"";
}
```
---
### 4οΈβ£ Run Tests
Execute tests using Maven:
```sh
mvn clean test
```
---
### 5οΈβ£ Generate Allure Report
After running the tests, generate the Allure report:
```sh
allure serve target/allure-results
```
---
## π Test Cases
| Test Name | Description |
|------------------------|----------------------------------------------|
| **testCreateBucket** | Checks if the bucket exists, creates if not |
| **testUploadFile** | Uploads a test file to the bucket |
| **testListFiles** | Verifies the uploaded file exists in bucket |
| **testGenerateSignedUrl** | Generates a signed URL for the uploaded file |
### πΉ Associated gcloud Commands
| Operation | gcloud Command |
|-----------|----------------|
| **Create Bucket** | `gcloud storage buckets create gs:// --location=me-west1` |
| **Upload File** | `gcloud storage cp test-file.txt gs:///` |
| **List Files** | `gcloud storage ls gs:///` |
| **Generate Signed URL** | `gcloud storage sign-url --duration=10m gs:///test-file.txt` |
---
## π Reporting System
The project integrates **Allure Reports** for test execution insights. Reports include:
- **Test results** (pass/fail)
- **Execution time breakdown**
- **Detailed logs per test**
---
## π Project Structure
```
CloudStorageCLI-Testing/
βββ .allure/ # Allure reporting files
βββ .idea/ # IntelliJ project settings
βββ allure-results/ # Allure test results
βββ src/
β βββ main/java/com/cloudstorage/
β β βββ config/ # Configuration class
β β β βββ ProjectConfig.java
β β βββ utils/ # Utility classes
β β β βββ CommandRunner.java
β β β βββ PlaywrightManager.java
β βββ test/java/com/cloudstorage/
β β β βββ tests/
β β β β βββ GCloudStorageTests.java # Tests for gcloud CLI
β β β β βββ PlaywrightSignedURLTest.java # Playwright tests for signed URL security
β β β βββ resources/
β β β β βββtestng.xml # TestNG configuration
βββ target/ # Compiled test results
βββ .gitignore # Git ignore file
βββ phishing_check.png # Screenshot for Playwright test
βββ pom.xml # Maven dependencies
βββ readme.md # Project documentation
βββ test-file.txt # Test file for uploads
βββ
```
---
## π¨ ScreenShots of Allure Report


---
## π License
This project is for educational and testing purposes. Modify and use it as needed!
1. docker build -t gcloud-tests .
2. docker run -it --rm gcloud-tests
3. gcloud auth login
4. ENTER THE VERIFICATION CODE
5.