Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added drivers/chromedriver.exe
Binary file not shown.
10 changes: 7 additions & 3 deletions src/main/java/com/orasi/bluesource/EmployeePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.orasi.web.webelements.Checkbox;
import com.orasi.web.webelements.Element;
import com.orasi.web.webelements.Label;
import com.orasi.web.webelements.Listbox;
import com.orasi.web.webelements.Textbox;
import com.orasi.web.webelements.Webtable;
import com.orasi.web.webelements.impl.internal.ElementFactory;
Expand All @@ -17,9 +18,9 @@ public class EmployeePage {
/**Page Elements**/
@FindBy(xpath = "//tr[1]//a[@class='glyphicon glyphicon-pencil']") Button btnEditFirstProject;
@FindBy(xpath = "//div[@id='panel_body_1']//table") Webtable tblProjectInfo;
@FindBy(xpath = "//button[@data-target='#modal_1']") Button btnEditGeneral;
@FindBy(xpath = "//div//a[contains(text(),'Deactivate Employee')]") Button btnDeactivateEmployee;
@FindBy(xpath = "//div[@class='panel-heading']//a[contains(text(),'Deactivate')]") Button btnDeactivate;
@FindBy(xpath = "//*[@id=\'accordion\']/div/div[7]/button") Button btnEditGeneral;
@FindBy(partialLinkText = "Deactivate Employee") Button btnDeactivateEmployee;
@FindBy(partialLinkText = "Deactivate") Button btnDeactivate;

/**Constructor**/
public EmployeePage(OrasiDriver driver){
Expand Down Expand Up @@ -59,15 +60,18 @@ public boolean verifyStartDate(String strStartDate, String strProject) {
}

public void editGeneralInfo() {
btnEditGeneral.syncVisible(3, true);
btnEditGeneral.click();

}

public void clickDeactivateEmployee() {
btnDeactivateEmployee.syncVisible(2, true);
btnDeactivateEmployee.click();
}

public void clickDeactivate(){
btnDeactivateEmployee.syncVisible(2, true);
btnDeactivate.click();
}

Expand Down
10 changes: 6 additions & 4 deletions src/main/java/com/orasi/bluesource/Employees.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ public void employeeSearch(String strSearch){
* @author Paul
*/
public void clickAddEmployee() {
btnAdd.syncEnabled(5,true);
btnAdd.click();
btnAdd.syncVisible(2,true);
btnAdd.syncEnabled(2,true);
btnAdd.syncInFrame(2,true);
btnAdd.click();
}

/**
Expand Down Expand Up @@ -309,7 +311,7 @@ public boolean checkAccountPermissionOption(String strOption) {
catch (OptionNotInListboxException e){
return false;
}

}

}
9 changes: 6 additions & 3 deletions src/main/java/com/orasi/bluesource/Header.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,12 @@ else if (accountBool == false)
* @author Paul
*/
public void navigateEmployees() {
MessageCenter messageCenter = new MessageCenter(driver);
messageCenter.closeMessageCenter();
lnkEmployees.click();
lnkEmployees.syncVisible(2,true);
// MessageCenter messageCenter = new MessageCenter(driver);
// messageCenter.closeMessageCenter();
lnkEmployees.syncVisible(2,true);
lnkEmployees.syncInFrame(2,true);
lnkEmployees.click();
}

public void navigateProjectEmployees() {
Expand Down
69 changes: 69 additions & 0 deletions src/main/java/com/orasi/bluesource/Reporting.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package com.orasi.bluesource;

import org.openqa.selenium.support.FindBy;

import com.orasi.web.OrasiDriver;
import com.orasi.web.webelements.Button;
import com.orasi.web.webelements.Link;
import com.orasi.web.webelements.Textbox;
import com.orasi.web.webelements.impl.internal.ElementFactory;


public class Reporting {
private OrasiDriver driver = null;


/**Page Elements**/
@FindBy(id = "employee_username") private Textbox txtUsername;
@FindBy(id = "employee_password") private Textbox txtPassword;
@FindBy(xpath = "//div[3]/input") private Button btnSubmitLogin;
@FindBy(xpath = "/html/body/nav/div/div/a/span/img") private Button btnLogo;
@FindBy(xpath = "/html/body/nav/div/div/ul/li[2]/a") private Link lnkCompany2;
@FindBy(id = "welcome") private Button btnWelcome;
@FindBy(xpath = "//*[@id=\"logout\"]/ul/li[2]/a") private Link lnkLogout;
@FindBy(xpath = "/html/body/nav/div/div/a") private Link lnkCompanyDropdown;

/**Constructor**/
public Reporting(OrasiDriver driver){
this.driver = driver;
ElementFactory.initElements(driver, this);
}

/**Page Interactions**/

/**
* This method verifys there is a logo listed for the company
* @return boolean - If the logo exists
* @author Andrew McGrail
*/
public boolean checkLogo() {
if(btnLogo.getAttribute("src").isEmpty())
return false;
return true;
}

/**
* This method logs into Blue Source Reporting
* @author Andrew McGrail
*/
public void adminLogin() {
driver.get("http://10.238.243.127:8080/reporting/login");
txtUsername.set("company.admin");
txtPassword.set("123");
btnSubmitLogin.click();
}

public void clickLogo() {
lnkCompanyDropdown.click();
}

public void clickCompany2() {
lnkCompany2.click();
}

public void logout() {
btnWelcome.click();
lnkLogout.syncVisible(2,true);
lnkLogout.click();
}
}
62 changes: 62 additions & 0 deletions src/test/java/com/bluesource/RemoveOrasiLogoFromReports.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/**
* This class tests Issue947_RemoveOrasiLogoFromReports
* This test logs into BlueSource Reporting, chooses a company
* and ensures the logo changed
* @author Andrew McGrail
*/
package com.bluesource;

import org.testng.ITestContext;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Optional;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

import com.orasi.bluesource.Reporting;
import com.orasi.utils.TestReporter;
import com.orasi.web.WebBaseTest;

public class RemoveOrasiLogoFromReports extends WebBaseTest {

@BeforeMethod
@Parameters({ "runLocation", "browserUnderTest", "browserVersion",
"operatingSystem", "environment" })
public void setup(@Optional String runLocation, String browserUnderTest,
String browserVersion, String operatingSystem, String environment) {
setApplicationUnderTest("BLUESOURCE");
setBrowserUnderTest(browserUnderTest);
setBrowserVersion(browserVersion);
setOperatingSystem(operatingSystem);
setRunLocation(runLocation);
setEnvironment(environment);
setThreadDriver(true);
testStart("");
}

@AfterMethod
public void close(ITestContext testResults){
endTest("TestAlert", testResults);
}

@Test
public void testRemoveOrasiLogoFromReports() {
Reporting reporting = new Reporting(getDriver());

//Step 1 Open Browser
//Step 2 Navigate to Bluesource reporting
//Step 3 Login to Reporting
reporting.adminLogin();
TestReporter.logStep("Successfully logged into BlueSource Reporting as Admin");
//Step 4 Click on the Company icon, located at the top left of the page
reporting.clickLogo();
//Step 5 Choose one of the items from the list
reporting.clickCompany2();
TestReporter.logStep("Selected a Company");
TestReporter.assertTrue(reporting.checkLogo(), "Verifying the Logo appeared when choosing a company");
//Step 6 Click on the username, located at the top right of the page to log out
reporting.logout();


}
}
Binary file added src/test/resources/drivers/chromedriver.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion src/test/resources/sandbox.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<test name="In Progress test" parallel="methods" thread-count="20">
<classes>
<class name="com.bluesource.accounts.CreateAccount" />
<class name="com.bluesource.RemoveOrasiLogoFromReports" />
</classes>
</test>

Expand Down