StrikekitStrikekit

Login examples

Happy path and invalid credentials as complete .stk files

Copy into login.stk. Set env vars or hard-code URLs/credentials for local runs.

Happy path

# login.stk — Authentication happy path
Platform: web

Group: Authentication

    Scenario: User login happy path @smoke @auth
        Given I navigate to "$BASE_URL/login"
        When I fill "username" with "$TEST_USER"
        And I fill "password" with "$TEST_PASSWORD"
        And I click on "Login"
        Then I should see "Welcome back"
        And I should not see "Invalid credentials"
        And I should be on "/dashboard"
export BASE_URL="https://example.com"
export TEST_USER=chamodh
export TEST_PASSWORD=secret123
strikekit run --browsers chrome login.stk
strikekit run --tag smoke login.stk

Invalid credentials

Platform: web

Group: Authentication

    Scenario: User login with invalid credentials @auth
        Given I navigate to "$BASE_URL/login"
        When I fill "username" with "wronguser"
        And I fill "password" with "wrongpass"
        And I click on "Login"
        Then I should see "Invalid credentials"
        And I should not see "Welcome back"

Both scenarios in one file

Platform: web

Group: Authentication

    Scenario: User login happy path @smoke @auth
        Given I navigate to "$BASE_URL/login"
        When I fill "username" with "$TEST_USER"
        And I fill "password" with "$TEST_PASSWORD"
        And I click on "Login"
        Then I should see "Welcome back"

    Scenario: User login with invalid credentials @auth
        Given I navigate to "$BASE_URL/login"
        When I fill "username" with "wronguser"
        And I fill "password" with "wrongpass"
        And I click on "Login"
        Then I should see "Invalid credentials"

On this page