Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions tests/e2e/cucumber.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const { Before, BeforeAll, AfterAll, After, setDefaultTimeout } = require("@cucumber/cucumber");
const { chromium } = require("@playwright/test");
require('dotenv').config();

const timeout = process.env.ASYNC_TIMEOUT ? parseInt(process.env.ASYNC_TIMEOUT) : 60000;
setDefaultTimeout(timeout);

BeforeAll(async function () {
global.browser = await chromium.launch({
headless: process.env.HEADLESS === "true",
slowMo: process.env.SLOW_MO ? parseInt(process.env.SLOW_MO) : 0,
})
});

Before(async function () {
global.context = await global.browser.newContext();
global.page = await global.context.newPage();
});

After(async function () {
await global.page.close();
await global.context.close();
});

AfterAll(async function() {
await global.browser.close();
});
32 changes: 32 additions & 0 deletions tests/e2e/features/search.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Feature: search
As a user
I want to search a product
So that I can manage the product

Rule: a rule

# Background:
# Given user "admin" has logged in
# And the user has navigated to the admin dashboard

Scenario: try to search for a product
Given user "admin" has logged in
But user doesn't do this
And the user does this
When the user searches for product "gown"
And the user does this
But user doesn't do this
Then the result should be empty
And tfrom ThenBut from then
But user doesn't do this

Scenario Outline:Search a product
Given user "admin" has logged in
When the user searches for product "<product>"
And the user does this
But user doesn't do this
Then the user should see results for the product "<product>"
Examples:
| product |
| sweater |
| jeans |
Loading