java - 在执行功能文件之前删除范围报告html文件的方法?

标签 java selenium automation bdd selenium-extent-report

Feature: Capability(Model) module feature

Scenario: User is Logged In
    Given Accelare url is launched
    When User Enters valid username "yashodeep.patil@nitorinfotech.com" and password "Workfit2511#"
    Then Verify if App Testing Accelare is opened
    And Click on verify app testing page

Scenario: Create a new model
    Given user navigated to new model form
    When User click on new model link
    Then User is able to see the model in dropdown model
  And Click on verify app testing page


Scenario: Import the model
    Given User navigate to the model import window
    When user click on design button
    Then user is able to upload the model
    And Click on verify app testing page

Scenario: Export the model  
    Given User navigate to the model export window
    When user click on Export button
    Then user is able to export the model
    And Click on verify app testing page

我想在执行功能文件之前删除 HTML 报告,因为发生了什么 HTML 报告文件正在覆盖该文件。

enter image description here

最佳答案

可以使用before注释来删除文件

如果您想在每个功能文件执行之前删除 HTML 文件,请向功能文件添加一些注释,并在 Before 方法中使用相同的注释,如下所示

功能:

@feature1
Feature: Capability(Model) module feature

Scenario: User is Logged In

在Before hooks中,您可以执行HTML报告删除操作。

@Before("@feature1")
public void beforeFeature() {
  // HTML Delete Actions
}

关于java - 在执行功能文件之前删除范围报告html文件的方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51551833/

相关文章:

selenium - 如何在 Perl 中使用 selenium 验证网站是否发送 2XX 响应?

java - 无法打开链接作为后台选项卡 - Java、Selenium、IE

java - 使用相同数据调用方法时出错(总是生成新数据)

java - 如何更改内部类中局部变量的值?

java - 添加基本​​身份验证时遇到问题

Selenium:是否可以在不安装浏览器的情况下启动浏览器

python - Selenium Webdriver wait.until 不起作用

java - 在虚拟机内自动移动鼠标,独立于真实鼠标

Java MigLayout 垂直对齐

java - 使用我的条形码扫描器应用程序时收到意外的对话框消息