The Decathlon user is on the registration page.
The Decathlon user enters valid information (name, email, and password).
The Decathlon user should be successfully registered.
The Decathlon user should be redirected to the login page.
const chai = require('chai');
const expect = chai.expect;
const registrationPage = require('../pages/registrationPage');
describe('Decathlon user Registration', function() {
it('should register Decathlon user successfully', function() {
registrationPage.open();
registrationPage.fillRegistrationForm('John Doe', '[email protected]', 'Password123');
registrationPage.submitForm();
expect(registrationPage.getSuccessMessage()).to.equal('Registration successful');
expect(browser.getUrl()).to.include('/login');
});
});
The Decathlon user is on the homepage.
The Decathlon user selects a sport category (e.g., Running).
The Decathlon user should be shown the relevant products in the selected category.
The Decathlon user should be able to filter products by price and brand.
const chai = require('chai');
const expect = chai.expect;
const homepage = require('../pages/homepage');
const productPage = require('../pages/productPage');
describe('Product Browsing', function() {
it('should display products in the selected category', function() {
homepage.open();
homepage.selectCategory('Running');
expect(productPage.getProductList()).to.not.be.empty;
expect(browser.getUrl()).to.include('/running');
});
it('should filter products by price and brand', function() {
productPage.filterProducts('Nike', 'Under $50');
expect(productPage.getFilteredProducts()).to.include('Nike');
expect(productPage.getFilteredProducts()).to.include('Under $50');
});
});
The Decathlon user is logged in and viewing a product.
The Decathlon user clicks the "Add to Cart" button.
The product should be added to the cart.
The Decathlon user should be able to view the updated cart with the added product.
const chai = require('chai');
const expect = chai.expect;
const productPage = require('../pages/productPage');
const cartPage = require('../pages/cartPage');
describe('Shopping Cart Management', function() {
it('should add products to the cart successfully', function() {
productPage.open();
productPage.addToCart();
expect(cartPage.getCartItemCount()).to.equal(1);
expect(cartPage.getCartProductName()).to.include('Product Name');
});
});
The Decathlon user has added products to their cart.
The Decathlon user navigates to the checkout page and enters valid payment information.
The Decathlon user should see an order summary.
The Decathlon user should receive an order confirmation.
const chai = require('chai');
const expect = chai.expect;
const checkoutPage = require('../pages/checkoutPage');
describe('Checkout Process', function() {
it('should complete the checkout process successfully', function() {
checkoutPage.open();
checkoutPage.enterPaymentInfo('John Doe', '4111111111111111', '12/25', '123');
checkoutPage.submitOrder();
expect(checkoutPage.getOrderConfirmation()).to.include('Order confirmed');
expect(browser.getUrl()).to.include('/order-summary');
});
});
The Decathlon user is logged in and has placed an order.
The Decathlon user navigates to the order tracking page and enters their order ID.
The Decathlon user should be shown the current status of their order (e.g., "Shipped", "Delivered").
const chai = require('chai');
const expect = chai.expect;
const orderTrackingPage = require('../pages/orderTrackingPage');
describe('Order Tracking', function() {
it('should track the order status successfully', function() {
orderTrackingPage.open();
orderTrackingPage.enterOrderId('12345');
expect(orderTrackingPage.getOrderStatus()).to.include('Shipped');
});
});
The Decathlon user has purchased a product and is on the product page.
The Decathlon user submits feedback with a rating and a comment.
The feedback should be successfully submitted.
The Decathlon user should see the feedback on the product page.
const chai = require('chai');
const expect = chai.expect;
const productPage = require('../pages/productPage');
describe('Product Feedback', function() {
it('should submit product feedback successfully', function() {
productPage.open();
productPage.submitFeedback('4', 'Good product, but could be improved');
expect(productPage.getFeedbackConfirmation()).to.equal('Feedback submitted successfully');
expect(productPage.getFeedbackText()).to.include('Good product, but could be improved');
});
});
The admin is logged in and on the admin dashboard.
The admin adds a new product with name, price, and description.
The new product should be visible in the product catalog.
The product details should be correctly displayed.
const chai = require('chai');
const expect = chai.expect;
const adminDashboard = require('../pages/adminDashboard');
const productManagementPage = require('../pages/productManagementPage');
describe('Admin Product Management', function() {
it('should add a new product successfully', function() {
adminDashboard.open();
adminDashboard.navigateToProductManagement();
productManagementPage.addNewProduct('New Product', '29.99', 'A great product.');
expect(productManagementPage.getProductName()).to.equal('New Product');
expect(productManagementPage.getProductPrice()).to.equal('29.99');
});
});
The support staff is logged in and viewing a customer inquiry.
The support staff responds to the inquiry with a solution.
The customer should receive a response.
The support staff should see the status as "Resolved".
const chai = require('chai');
const expect = chai.expect;
const supportDashboard = require('../pages/supportDashboard');
const supportTicketPage = require('../pages/supportTicketPage');
describe('Support Staff Management', function() {
it('should resolve a customer inquiry successfully', function() {
supportDashboard.open();
supportDashboard.viewInquiry('12345');
supportTicketPage.respondToInquiry('Solution to the issue');
expect(supportTicketPage.getTicketStatus()).to.equal('Resolved');
expect(supportTicketPage.getCustomerResponse()).to.include('Solution to the issue');
});
});