Commit 8c99ba08 authored by Nikitha Moosapet's avatar Nikitha Moosapet

Commiting the POM assignment

parent b57691b6
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="POM Testing" />
</profile>
</annotationProcessing>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="2284ab96-4aea-483c-bde1-eab51d4dd591" name="Default Changelist" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FavoritesManager">
<favorites_list name="POM Testing" />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Class" />
</list>
</option>
</component>
<component name="MavenImportPreferences">
<option name="importingSettings">
<MavenImportingSettings>
<option name="importAutomatically" value="true" />
</MavenImportingSettings>
</option>
</component>
<component name="ProjectId" id="1r7tDPWZOW2lGYPhfQSImwsFtKt" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showExcludedFiles" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="project.structure.last.edited" value="Project" />
<property name="project.structure.proportion" value="0.0" />
<property name="project.structure.side.proportion" value="0.2" />
<property name="settings.editor.selected.configurable" value="reference.settingsdialog.project.gradle" />
</component>
<component name="RunManager">
<configuration name="SafewayWebPagesTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="POM Testing" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.nisum.safewaypages.testing.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="com.nisum.safewaypages.testing" />
<option name="MAIN_CLASS_NAME" value="com.nisum.safewaypages.testing.SafewayWebPagesTest" />
<option name="TEST_OBJECT" value="class" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<recent_temporary>
<list>
<item itemvalue="JUnit.SafewayWebPagesTest" />
</list>
</recent_temporary>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="2284ab96-4aea-483c-bde1-eab51d4dd591" name="Default Changelist" comment="" />
<created>1618338835340</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1618338835340</updated>
</task>
<servers />
</component>
<component name="WindowStateProjectService">
<state x="320" y="117" key="#Project_Structure" timestamp="1618338870476">
<screen x="0" y="0" width="1440" height="900" />
</state>
<state x="320" y="117" key="#Project_Structure/0.0.1440.900@0.0.1440.900" timestamp="1618338870475" />
<state x="458" y="224" key="#com.intellij.codeInsight.editorActions.RestoreReferencesDialog" timestamp="1618376856337">
<screen x="0" y="0" width="1440" height="900" />
</state>
<state x="458" y="224" key="#com.intellij.codeInsight.editorActions.RestoreReferencesDialog/0.0.1440.900@0.0.1440.900" timestamp="1618376856337" />
<state x="533" y="174" key="#com.intellij.ide.util.MemberChooser" timestamp="1618342536956">
<screen x="0" y="0" width="1440" height="900" />
</state>
<state x="533" y="174" key="#com.intellij.ide.util.MemberChooser/0.0.1440.900@0.0.1440.900" timestamp="1618342536956" />
<state width="1398" height="303" key="GridCell.Tab.0.bottom" timestamp="1618384410202">
<screen x="0" y="0" width="1440" height="900" />
</state>
<state width="1398" height="303" key="GridCell.Tab.0.bottom/0.0.1440.900@0.0.1440.900" timestamp="1618384410202" />
<state width="1398" height="303" key="GridCell.Tab.0.center" timestamp="1618384410200">
<screen x="0" y="0" width="1440" height="900" />
</state>
<state width="1398" height="303" key="GridCell.Tab.0.center/0.0.1440.900@0.0.1440.900" timestamp="1618384410200" />
<state width="1398" height="303" key="GridCell.Tab.0.left" timestamp="1618384410199">
<screen x="0" y="0" width="1440" height="900" />
</state>
<state width="1398" height="303" key="GridCell.Tab.0.left/0.0.1440.900@0.0.1440.900" timestamp="1618384410199" />
<state width="1398" height="303" key="GridCell.Tab.0.right" timestamp="1618384410201">
<screen x="0" y="0" width="1440" height="900" />
</state>
<state width="1398" height="303" key="GridCell.Tab.0.right/0.0.1440.900@0.0.1440.900" timestamp="1618384410201" />
<state width="1398" height="303" key="GridCell.Tab.1.bottom" timestamp="1618384410205">
<screen x="0" y="0" width="1440" height="900" />
</state>
<state width="1398" height="303" key="GridCell.Tab.1.bottom/0.0.1440.900@0.0.1440.900" timestamp="1618384410205" />
<state width="1398" height="303" key="GridCell.Tab.1.center" timestamp="1618384410204">
<screen x="0" y="0" width="1440" height="900" />
</state>
<state width="1398" height="303" key="GridCell.Tab.1.center/0.0.1440.900@0.0.1440.900" timestamp="1618384410204" />
<state width="1398" height="303" key="GridCell.Tab.1.left" timestamp="1618384410203">
<screen x="0" y="0" width="1440" height="900" />
</state>
<state width="1398" height="303" key="GridCell.Tab.1.left/0.0.1440.900@0.0.1440.900" timestamp="1618384410203" />
<state width="1398" height="303" key="GridCell.Tab.1.right" timestamp="1618384410204">
<screen x="0" y="0" width="1440" height="900" />
</state>
<state width="1398" height="303" key="GridCell.Tab.1.right/0.0.1440.900@0.0.1440.900" timestamp="1618384410204" />
<state x="208" y="33" key="SettingsEditor" timestamp="1618383537418">
<screen x="0" y="0" width="1440" height="900" />
</state>
<state x="208" y="33" key="SettingsEditor/0.0.1440.900@0.0.1440.900" timestamp="1618383537418" />
<state x="374" y="265" key="com.intellij.ide.util.TipDialog" timestamp="1618355429249">
<screen x="0" y="23" width="1440" height="821" />
</state>
<state x="374" y="265" key="com.intellij.ide.util.TipDialog/0.23.1440.821@0.23.1440.821" timestamp="1618355429249" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4" />
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>POMTesting</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
package com.nisum.safewaypages.testing;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.PageFactory;
import java.util.concurrent.TimeUnit;
public class AccountsPage {
private static WebDriver driver;
public AccountsPage(WebDriver driver) {
this.driver = driver;
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
PageFactory.initElements(driver, this);
}
public WebElement menuAccountLink(){
return driver.findElement(By.linkText("Account"));
}
public WebElement sideBarAccountsSettings(){
return driver.findElement(By.xpath("//*[@id=\"menu\"]/div[1]/ul/li[4]/a"));
}
public WebElement enterFirstName(){
return driver.findElement(By.id("input-firstName"));
}
public WebElement enterLastName(){
return driver.findElement(By.id("input-lastName"));
}
public WebElement enterEmail(){
return driver.findElement(By.id("emailIdaccount"));
}
public WebElement enterPhoneNumber(){
return driver.findElement(By.id("phoneNumber"));
}
public void navigateToAccountSettingsPage(String url) {
driver.get(url);
menuAccountLink().click();
sideBarAccountsSettings();
}
}
package com.nisum.safewaypages.testing;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import java.util.concurrent.TimeUnit;
public class HomePage {
private static WebDriver driver;
public HomePage(WebDriver driver) {
this.driver=driver;
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
PageFactory.initElements(driver, this);
}
@FindBy(xpath = "//span[@class='button__item menu-nav__profile-button-sign-in-up d-none d-lg-inline-block']")
WebElement menuSignInLink;
@FindBy(id = "sign-in-modal-link")
WebElement sideBarSignIn;
//To confirm the Page is opened
public boolean isHomePageOpened(){
return menuSignInLink.getText().contains("Sign In / Up");
}
public void navigateToHomePage(String url){
driver.get(url);
menuSignInLink.click();
sideBarSignIn.click();
}
}
package com.nisum.safewaypages.testing;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindAll;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import java.util.concurrent.TimeUnit;
public class LoginPage {
private static WebDriver driver;
public LoginPage (WebDriver driver){
this.driver=driver;
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
PageFactory.initElements(driver, this);
}
@FindBy(id = "label-email")
WebElement signInUsername;
@FindAll({
@FindBy(id ="label-password"),
@FindBy(name = "inputPassword"),
@FindBy(xpath = "//*[@id=\"label-password\"]")})
WebElement signInPassword;
@FindBy(id = "btnSignIn")
WebElement clickSignIn;
public void login(String username, String password){
signInUsername.sendKeys(username);
signInPassword.sendKeys(password);
clickSignIn.click();
}
}
driverPath = "/Users/nmoosapet/documents/softwares/chromedriver";
url = "https://www.safeway.com/"
username="nikithayadav95@gmail.com"
password="safeway123"
package com.nisum.safewaypages.testing;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.StaleElementReferenceException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
public class SafewayWebPagesTest {
private String driverPath = "/Users/nmoosapet/documents/softwares/chromedriver";
private static WebDriver driver;
private WebDriverWait driverWait;
private HomePage objHomePage;
private LoginPage objLoginPage;
private AccountsPage objAccountsPage;
private String url = "https://www.safeway.com/";
private Properties properties;
private String username="nikithayadav95@gmail.com";
private String password="safeway123";
@Before
public void setup(){
System.setProperty("webdriver.chrome.driver",driverPath);
this.driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driverWait = new WebDriverWait(driver, 20);
objHomePage = new HomePage(driver);
objLoginPage = new LoginPage(driver);
objAccountsPage = new AccountsPage(driver);
}
@Test
public void testPages(){
objHomePage.navigateToHomePage(url);
Assert.assertTrue(objHomePage.isHomePageOpened());
System.out.println("Successfully routed to the safeway website page");
objHomePage.menuSignInLink.click();
objHomePage.sideBarSignIn.click();
objLoginPage.login(username, password);
Assert.assertEquals("nikithayadav95@gmail.com", objLoginPage.signInUsername.getAttribute("value"));
Assert.assertEquals("safeway123", objLoginPage.signInPassword.getAttribute("value"));
System.out.println("User Credentials verified and user logged in successfully");
objLoginPage.clickSignIn.click();
objAccountsPage.navigateToAccountSettingsPage(url);
objAccountsPage.menuAccountLink().click();
objAccountsPage.sideBarAccountsSettings();
driverWait.until(ExpectedConditions.elementToBeClickable(By.id("input-firstName")));
Assert.assertEquals("Nikitha", objAccountsPage.enterFirstName().getAttribute("value"));
Assert.assertEquals("Moosapet", objAccountsPage.enterLastName().getAttribute("value"));
Assert.assertEquals("nikithayadav95@gmail.com", objAccountsPage.enterEmail().getAttribute("value"));
System.out.println("User Info verified and updated successfully");
}
@After
public void tearDown(){
driver.quit();
}
}
driverPath = "/Users/nmoosapet/documents/softwares/chromedriver";
url = "https://www.safeway.com/"
username="nikithayadav95@gmail.com"
password="safeway123"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment