cypress\integration\test\FileNumber.feature
Scenario: Retrieve a list of file records
Given when user try to retrieve a list of file records
When user provides file number as "00TEST"
And clicks on search button
Then User able to see the file details
cypress\integration\test\ProductId.feature
Scenario: Retrieve a list of product records
Given when user try to retrieve a list of product records
When user provides product number as "01PROD"
And clicks on search button
Then User able to see the product details
cypress\support\step_definitons\Viewfiles.js
import { And, Given, Then, When } from "cypress-cucumber-preprocessor/steps";
import adminPage from '../pageobjects/adminPage';
Given("when user try to retrieve a list of file records", () => { adminPage.launchadmin(); });
When("user provides file number as {string}", (fileNumber) => { adminPage.fileNumberCheck(fileNumber); })
And("clicks on search button", () => { adminPage.searchButton(); }) Then("User able to see the file details", () => { adminPage.verifyTitleSucccessfullyLanded(); })
cypress\support\step_definitons\Viewproducts.js
import { And, Given, Then, When } from "cypress-cucumber-preprocessor/steps";
import adminPage from '../pageobjects/adminPage';
Given("when user try to retrieve a list of product records", () => { adminPage.launchadminNew(); });
When("user provides product number as {string}", (productNumber) => { adminPage.productNumberCheck(productNumber); })
And("clicks on search button", () => { adminPage.productSearchButton(); }) Then("User able to see the product details", () => { adminPage.verifyTitleSucccessfullyLanded(); })
cypress\support\pageobjects\adminPage
const FILE_NUMBER = '#fileNumber'
const PRODUCT_NUMBER = '#productNumber'
const PRODUCT_SEARCH_BTN='#productNumberSearch'
static launchadmin() { cy.url() .should('include', 'localhost:3000/') } static launchadminNew() { cy.visit( "localhost:3000/product" ); }
static fileNumberCheck(fileNumber) { cy.get(FILE_NUMBER).type(fileNumber) }
static productNumberCheck(productNumber) { cy.get(PRODUCT_NUMBER).type(productNumber) }
static searchButton() { cy.get(SEARCH_BTN).click() }
static productSearchButton() { cy.get(PRODUCT_SEARCH_BTN).click() }