0
'public void logo(Method method, ITestContext context) throws IOException {//new ScreenShotUtil().elementScreenshot(driver,driver.findElement(By.xpath("//*[local-name()='svg']//parent::div[@class='ui__logo']")), "standardLogo");
        context.getCurrentXmlTest().addParameter("image", "name");
        test = extent.createTest(method.getName(), "Some Description");
        test.info("Logo Comaparision");
        driver.switchTo().frame("storybook-preview-iframe");
        new ScreenShotUtil().pageScreenshot(driver,"Welcome");
        boolean bol = new ScreenShotUtil().areImageEqual("Xlogo", "Welcome");
        if(bol)
            test.log(Status.PASS, "Images are matching");
        else {
           test.log(Status.FAIL, String.valueOf(test.addScreenCaptureFromPath(System.getProperty("user.dir")+"\\Images\\diffimages\\Xlogo.png")));
           //test.log(Status.FAIL, "Images are not matching", test.addScreenCaptureFromPath(System.getProperty("user.dir")+"\\Images\\diffimages\\Xlogo.png"));
        }
        Assert.assertTrue(bol);
       // Assert.assertTrue(new ScreenShotUtil().areImageEqual("Xlogo", "Welcome"));
    }'
    

上述测试失败。在报告的测试选项卡中,没有看到任何测试被创建。请参考随附的屏幕截图在此处输入图像描述

4

0 回答 0