You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1.9 KiB

Playwright Cucumber Test Automation

A test automation framework using Playwright, Cucumber, and TestNG, designed for both UI and API testing.

📂 Project Structure

main
├── kotlin
│   ├── core                # Core modules (exceptions, listeners, properties)
│   ├── utils               # API and utility classes
│   ├── web                 # Browser and UI element handling
│   ├── projects/example    # Step Definitions for Cucumber
│   └── resources           # Configuration files (e.g., urls.properties)
└── test
    └── kotlin             # Test classes (UI and API)

🚀 Quick Start

  1. Clone the repository:

    git clone https://tapo4ek-git.duckdns.orgTapo4ek/Pitche_Test_Task.git
    cd <project-name>
    
  2. Run tests: Ensure testng.xml is located in src/test/resources. Then execute tests:

    ./gradlew clean test
    
  3. Filter by tags (for Cucumber scenarios):

    ./gradlew test -Dcucumber.filter.tags="@"
    

🛠 Configuration

  • urls.properties: Used to store base URLs or other properties:

    baseUrl=https://example.com
    
  • testng.xml: Defines the test suites and classes to run:

    <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
    <suite name="Suite">
        <listeners>
            <listener class-name="core.listeners.TestNGListener" />
        </listeners>
        <test name="ExampleUISuite">
            <classes>
                <class name="UITestTask" />
            </classes>
        </test>
        <test name="ExampleApiSuite">
            <classes>
                <class name="ApiTestTask" />
            </classes>
        </test>
    </suite>
    

📂 Tools Used

  • Playwright: For browser automation.
  • Cucumber: For BDD-style test definitions.
  • TestNG: For test execution management.
  • Gradle: For build and dependency management.