package com.playwrightdemo.test;

import com.playwrightdemo.pages.LoginPage;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;

import java.io.IOException;
import com.playwrightdemo.pages.DashboardPage;
import org.testng.annotations.Test;

public class DashboardPageTest extends BaseTest{

    LoginPage loginPage;

    DashboardPage dashboardPage;


    DashboardPageTest(){

        super();
    }



    Logger logger= LogManager.getLogger(this.getClass());

    private void logTestMethodName(String status) {
        StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
        String methodName = stackTraceElements[2].getMethodName();
        logger.info("Test method '" + methodName + "' " + status);
    }

    @BeforeTest

    public void setUP() throws IOException {

     //   intialization();

       loginPage=new LoginPage();
       // loginPage.doLogin();
        dashboardPage=loginPage.fromLoginPage();
       //  dashboardPage=new DashboardPage();

    }

    @Test (enabled = true)

    public void verifyDashboardLandingPage() throws InterruptedException {

        Assert.assertEquals(dashboardPage.attendanceSelected(),"Attendance / leaves");
        logTestMethodName("passed");


    }





}
