This project is a UI test automation demo for TryCloud, a cloud-based collaboration software. The project is built using Java and Maven, and leverages Selenium for browser automation. The tests are written in a Behavior-Driven Development ( BDD) style using Cucumber, which allows for easy understanding of the test scenarios. The project also uses the JUnit testing framework, a popular choice for testing in Java applications. Maven is used for dependency management and build automation.
- Behavior-Driven Development (BDD): Tests are written in an easy-to-understand BDD style using Cucumber.
- Browser Automation: Utilizes Selenium for automating browser actions.
- JUnit Integration: Tests are executed using the JUnit framework.
- Dependency Management: Maven manages project dependencies and build configurations.
- Logging: Log4j is used for logging test execution details.
- Data Generation: JavaFaker is used to generate fake data for tests.
- Browser Driver Management: WebDriverManager handles the management of browser drivers required by Selenium.
- Parallel Testing: Implemented using the Maven Surefire plugin to run tests concurrently, improving test execution time.
- Pretty HTML Reports: Generates comprehensive and visually appealing HTML reports for test results.
The project follows the Page Object Model (POM) design pattern for creating page classes.
Advantages of POM:
- Code Reusability: Reduces code duplication by creating reusable page components.
- Maintainability: Easier to update and maintain tests when UI changes occur.
- Readability: Enhances test readability by separating test logic from page structure.
The Singleton design pattern is used for the WebDriver instance.
Benefits of Singleton Design Pattern:
- Single Instance: Ensures a single instance of WebDriver is created, avoiding multiple browser instances.
- Resource Management: Optimizes resource usage by reusing the same WebDriver instance.
- Thread Safety: Facilitates thread safety in parallel test execution scenarios.
The project includes a variety of tests to ensure the application's functionality is thoroughly verified. The test scenarios are organized into different user stories, each addressing specific functionalities:
- I should be able to log in with a valid username and password.
- I should not be able to log in with an invalid username or password.
- I should not be able to log in with an empty username or password.
- I should see the password as dots when I enter it.
- I should see the forgot password link.
- User should be able to see the module after login.
- User should be able to see the following modules after login:
- Files
- Activity
- Gallery
- Talk
- Calendar
- Deck
- Announcement
- User should be able to see the username after login.
- User should be able to see the search box after login.
- User should be able to see the notifications after login.
- User should be able to see the user icon after login.
- User should be able to see the profile and settings after clicking on the user icon.
- User can see at least the following titles inside personal info under Full name/Email/Phone Number:
- Full name
- Phone number
- Address
- Website
- Language
- Locale
- Profile picture
- User can change "Full name" info under Profile Settings page.
- User can make "Phone number" info private under Profile Settings page.
- User can see the current local time under the Local dropdown.
- User can change profile picture.
- User can change language settings.
- User can delete their account.
- User should be able to upload a file to a folder.
- User should be able to create a new folder.
- User should be able to move any item to any folder.
- User should be able to copy any item to any folder.
- User should be able to delete any item.
- User should be able to see the total number of files and folders under the files list table.
- src/test/java: Contains the step definitions, runners, utilities, hooks, and page objects for the Cucumber tests.
- src/test/resources: Contains the feature files with the BDD test scenarios.
- pom.xml: Maven configuration file that manages dependencies and plugins.
The pom.xml
file includes the following dependencies:
- Selenium: For browser automation.
- JUnit: For running the tests.
- Cucumber: For BDD style test definitions.
- Log4j: For logging.
- WebDriverManager: For managing browser drivers.
- JavaFaker: For generating fake data for tests.
- Maven Surefire Plugin: For running tests, with configuration for parallel test execution.
- Cucumber HTML Reporter: For generating pretty HTML reports of test results.
- Java 11 or higher
- Maven 3.6 or higher
-
Clone the repository:
git clone https://github.com/Zeeatree/trycloud-test-automation.git cd trycloud-test-automation
-
Install dependencies:
mvn clean install
-
Run the tests:
mvn test
- Thanks to the Selenium, JUnit, Cucumber, Log4j, and JavaFaker communities for their great tools and libraries.
- Special thanks to the TryCloud team for their software and support.