//the usernameString username = "Admin";//the Username text fieldGuiText usrName = new GuiText("Username");//set the usernameusrName.setText(username);//check that the username has been correctly insertedassertEquals(username, usrName.getText());
//the passwordString pwd = "admin123";//the Passoword text fieldGuiPasswordText password = new GuiPasswordText("Password");//set the password password.setText(pwd);//check that the password has been correctly insertedassertEquals(pwd, password.getText());
//click The Login buttonnew GuiButton("LOGIN").click();//check that the header "Dashboard" is present (fig.10)new GuiHtmlElement("Dashboard", AccessibleRoleMaveryx.WEB_H1).waitForObject(5, 1);//the Dashboard page URLString dashboardURL = "https://opensource-demo.orangehrmlive.com/index.php/dashboard";//check the Dashboard page URLassertEquals(dashboardURL, new GuiBrowser().getCurrentPageUrl());
//invalid username String username = "Admi";//the Username text fieldGuiText usrName = new GuiText("Username");//set the invalid usernameusrName.setText(username);//check that the username has been correctly insertedassertEquals(username, usrName.getText());//the password (valid)String pwd = "admin123";//the Passoword text fieldGuiPasswordText password = new GuiPasswordText("Password");//set the password password.setText(pwd);//check that the password has been correctly insertedassertEquals(pwd, password.getText());//click The Login buttonnew GuiButton("LOGIN").click();//check that the message "Invalid credentials" is present (fig.5)new GuiHtmlElement("Invalid credentials").waitForObject(5, 1);