public void VerifyProductDetailsAreDisplayedWhenUserClicksOnProductName() { productsPage = new ProductsPage(CmdDriver.Driver); yourOrderPage = new YourOrderPage(CmdDriver.Driver); extentReportUtils.createATestCase("Verify Product details are displayed when a user clicks on product name"); extentReportUtils.addTestLog(Status.Info, "VerifyProductDetailsAreDisplayedWhenUserClicksOnProductName"); productsPage.ClickAcceptAllCookies(); productsPage.ClickBuyNowButtonByProductName(ProductsEnum.DEVCRAFT_UI); string productName = HelperUtils.GetDescription(ProductsEnum.DEVCRAFT_UI); yourOrderPage.ClickAcceptAllCookies(); // Assert productDetails are not displayed Assert.IsFalse(yourOrderPage.IsProductDetailsDisplayedByProductName(productName)); // Click on product name yourOrderPage.ClickOnProductByProductName(productName); // Assert product details are displayed Assert.IsTrue(yourOrderPage.IsProductDetailsDisplayedByProductName(productName)); // Click again on product name yourOrderPage.ClickOnProductByProductName(productName); // Assert productDetails are not displayed Assert.IsFalse(yourOrderPage.IsProductDetailsDisplayedByProductName(productName)); }