2. Yêu cầu chức năng:

2.1. Sơ đồ ca sử dụng:

Hình 2.1: Sơ đồ ca sử dụng.

2.2. Features:

Feature: Navigating
    In order to navigate around the website
    As a customer
    I want the navigation bar works correctly

    Scenario: to the mainpage
        Given I am on the homepage
        When I follow "BETEZ Café"
        Then I should be on homepage
    Scenario: to the mainpage 2
        Given I am on the homepage
        When I follow "Home"
        Then I should be on homepage
    Scenario: go to login
        Given I am on the homepage
        When I follow "Đăng nhập"
        Then I should be on "login/"
    Scenario: go to register
        Given I am on the homepage
        When I follow "Đăng kí"
        Then I should be on "register/"
    Scenario: discover offers
        Given I am on the homepage
        When I follow "Khuyến mãi"
        Then I should be on "khuyen_mai/"
    Scenario: how to contact
        Given I am on the homepage
        When I follow "Liên hệ "
        Then I should see "Vài nét về BETEZ Café"

Feature: Order
    In order to order drinks
    As a customer
    I want to view all the drinks that I can order

    Scenario: checkout
        Given I am on homepage
        When I follow "checkout"
        Then I should be on "/checkout/"

Feature: Login
    In order to reuse my info
    As a customer
    I want to login to my account

    Scenario: login
        Given I am on "/login"
        When I fill in "username" with "[email protected]"
        And I fill in "password" with "123456"
        And I press "loginbutton"
        And I should see "Sample User"
    Scenario: login to admin
        Given I am on "/login"
        When I fill in "username" with "[email protected]"
        And I fill in "password" with "123456"
        And I press "loginbutton"
        Then I should be on "/admin/"
        And I should see "Admin"
    Scenario: login with wrong password
        Given I am on "/login"
        When I fill in "username" with "[email protected]"
        And I fill in "password" with "1234567"
        And I press "loginbutton"
        And I should see "Tên đăng nhập hoặc mật khẩu không chính xác"
    Scenario: login with wrong email
        Given I am on "/login"
        When I fill in "username" with "[email protected]"
        And I fill in "password" with "123456"
        And I press "loginbutton"
        And I should see "Tên đăng nhập hoặc mật khẩu không chính xác"
    Scenario: login with no password
        Given I am on "/login"
        When I fill in "username" with "[email protected]"
        And I press "loginbutton"
        And I should see "Bạn chưa nhập mật khẩu"
    Scenario: login with no email
        Given I am on "/login"
        And I fill in "password" with "1234567"
        And I press "loginbutton"
        And I should see "Bạn chưa nhập email"
    Scenario: login with nothing
        Given I am on "/login"
        And I press "loginbutton"
        And I should see "Bạn chưa điền thông tin để đăng nhập"

Feature: register
    In order to login
    As a customer
    I want to have an account

    Scenario: register
        Given I am on "register/"
        When I fill in "Họ" with "Sample"
        And I fill in "last_name" with "Customer"
        And I fill in "email" with "[email protected]"
        And I fill in "Mật khẩu" with "123456"
        And I fill in "Xác nhận mật khẩu" with "123456"
        And I check "Tôi đồng ý"
        And I press "registerbutton"
        Then I should be on "login/"

results matching ""

    No results matching ""