Open Jacobvu84 opened 3 years ago
Cách 2: The AfterAWebdriverScenario is called at the end of a test, just before the driver is closed, and once the result of the test is known. The test result (and other details) can be obtained from the TestOutcome parameter. This allows any last manipulations or checks to be performed on the driver, before the end of the test. The following example checks the result of the test that has just finished, and adds a cookie with a value depending on the test outcome:
public class MyTestResultUpdater implements AfterAWebdriverScenario {
void apply(EnvironmentVariables environmentVariables,
TestOutcome testOutcome,
WebDriver driver) {
final Logger LOGGER = LoggerFactory.getLogger(MyTestResultUpdater.class);
LOGGER.info("===>" + testOutcome.getTestCaseName());
}
}
Cách 1: