Skip to content

Add ReportDriver in TestLifecycle #148

@RameshBabuPrudhvi

Description

@RameshBabuPrudhvi

Is your feature request related to a problem? Please describe.
Nofier and Fullpage screenshot actions not working without explicityly calling ReportDriver setter and remove action

Describe the solution you'd like
Add ReportListener and ReportDriver setter actions in TestLifecycle.

import io.github.selcukes.core.driver.DriverManager;
import io.github.selcukes.core.listener.TestLifecyclePerMethod;
import io.github.selcukes.core.page.Pages;
import io.github.selcukes.core.page.WebPage;
import io.github.selcukes.reports.ReportDriver;
import io.github.selcukes.reports.listeners.TestNGReportListener;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;

@Listeners({TestLifecyclePerMethod.class, TestNGReportListener.class})
public class HelloWeb {
    WebPage page;

    @BeforeMethod
    public void beforeMethod() {
        page = Pages.webPage();
        ReportDriver.setReportDriver(DriverManager.getDriver());
    }

    @Test
    public void hello() {
        page.open("https://www.google.com/");
        page.assertThat().title("Hello");
    }

    @AfterMethod
    public void afterMethod() {
        ReportDriver.removeDriver();
    }
}

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions