diff --git a/webdriver/java/AddPoolRaid0with0Disks.java b/webdriver/java/AddPoolRaid0with0Disks.java new file mode 100644 index 0000000..9861cfd --- /dev/null +++ b/webdriver/java/AddPoolRaid0with0Disks.java @@ -0,0 +1,96 @@ +import java.io.File; +import java.io.FileInputStream; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.Select; // Dropdown menu +import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.support.ui.ExpectedConditions;// Explicit Waits +import org.openqa.selenium.support.ui.WebDriverWait; +import org.apache.commons.io.FileUtils; // Screenshots +import org.openqa.selenium.OutputType; +import org.openqa.selenium.TakesScreenshot; +import java.io.IOException; +import java.util.Properties; + + +public class AddPoolRaid0with0Disks { + + public static void main(String[] args) throws IOException { + // Create a new instance of the Firefox driver + + WebDriver driver = new FirefoxDriver(); + + try{ + + Properties prop = new Properties(); + prop.load(new FileInputStream("config.properties")); + driver.get(prop.getProperty("RockstorVm")); + + + //User Login Input Forms + WebElement username = driver.findElement(By.id("inputUsername")); + username.sendKeys("admin"); + + WebElement password = driver.findElement(By.id("inputPassword")); + password.sendKeys("admin"); + + WebElement submitButton = driver.findElement(By.id("sign_in")); + submitButton.click(); + + // Select Pools from Navigation bar + WebElement poolsNav = driver.findElement(By.id("pools_nav")); + poolsNav.click(); + + //Explicit Wait for Pools page to load + WebElement myWaitElement1 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("add_pool"))); + + WebElement addPool = driver.findElement(By.id("add_pool")); + addPool.click(); + + //Explicit Wait for CreatePools page. + WebElement myWaitElement2 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("create_pool"))); + + + WebElement poolname = driver.findElement(By.id("pool_name")); + poolname.sendKeys("pool1"); + + //Raid Configuration Dropdown box + Select raidConfigDroplist = new Select(driver.findElement(By.id("raid_level"))); + raidConfigDroplist.selectByIndex(0); + + //Create Pool + WebElement createPool = driver.findElement(By.id("create_pool")); + createPool.click(); + + WebElement myWaitElement3 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("delete_pool_pool1"))); + + } + //catch any exceptions by taking screenshots + catch(Exception e){ + + System.out.println(e.toString()); + + File screenshotFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); + FileUtils.copyFile(screenshotFile,new File("/home/priya/rockstor-tests/webdriver/java/ScreenShots/Raid0with0DiskPool.png")); + + } + + //click on logout + WebElement logoutSubmit = driver.findElement(By.id("logout_user")); + + logoutSubmit.click(); + + } +} + + + + + + + + diff --git a/webdriver/java/AddPoolRaid0with1Disk.java b/webdriver/java/AddPoolRaid0with1Disk.java new file mode 100644 index 0000000..4dd7bd7 --- /dev/null +++ b/webdriver/java/AddPoolRaid0with1Disk.java @@ -0,0 +1,104 @@ + +import java.io.File; +import java.io.FileInputStream; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.Select; // Dropdown menu +import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.support.ui.ExpectedConditions;// Explicit Waits +import org.openqa.selenium.support.ui.WebDriverWait; +import org.apache.commons.io.FileUtils; // Screenshots +import org.openqa.selenium.OutputType; +import org.openqa.selenium.TakesScreenshot; +import java.io.IOException; +import java.util.Properties; + + + +public class AddPoolRaid0with1Disk { + + public static void main(String[] args) throws IOException { + // Create a new instance of the Firefox driver + + + WebDriver driver = new FirefoxDriver(); + + try{ + + Properties prop = new Properties(); + prop.load(new FileInputStream("config.properties")); + driver.get(prop.getProperty("RockstorVm")); + + + // User Login Input forms + WebElement username = driver.findElement(By.id("inputUsername")); + username.sendKeys("admin"); + + WebElement password = driver.findElement(By.id("inputPassword")); + password.sendKeys("admin"); + + WebElement submit = driver.findElement(By.id("sign_in")); + submit.click(); + + // Select Pools from Navigation bar + WebElement poolsNav = driver.findElement(By.id("pools_nav")); + poolsNav.click(); + + //Explicit Wait for Pools page to load + WebElement myWaitElement1 = (new WebDriverWait(driver, 30)) + .until(ExpectedConditions.elementToBeClickable(By.id("add_pool"))); + + // Click create Pool Button + WebElement addPool = driver.findElement(By.id("add_pool")); + addPool.click(); + + //Explicit Wait for CreatePools page. + WebElement myWaitElement2 = (new WebDriverWait(driver, 30)) + .until(ExpectedConditions.elementToBeClickable(By.id("create_pool"))); + + //User Input Form to Select Pool Name + WebElement poolname = driver.findElement(By.id("pool_name")); + poolname.sendKeys("pool1"); + + //Raid Configuration Dropdown box + Select raidConfigDroplist = new Select(driver.findElement(By.id("raid_level"))); + raidConfigDroplist.selectByIndex(0); + + //Select Disks CheckBox + WebElement diskCheckBox1 = driver.findElement(By.id("sdb")); + diskCheckBox1.click(); + + //Create Pool + WebElement createPool = driver.findElement(By.id("create_pool")); + createPool.click(); + + //Wait for Pools page to load + WebElement myWaitElement3 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("delete_pool_pool1"))); + } + + //catch any exceptions by taking screenshots. + catch(Exception e){ + + System.out.println(e.toString()); + + File screenshotFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); + FileUtils.copyFile(screenshotFile,new File("/home/priya/rockstor-tests/webdriver/java/ScreenShots/Raid01DiskPool.png")); + + } + + //click on logout + WebElement logoutSubmit = driver.findElement(By.id("logout_user")); + + logoutSubmit.click(); + + } +} + + + + + + + diff --git a/webdriver/java/AddPoolRaid0with2Disks.java b/webdriver/java/AddPoolRaid0with2Disks.java new file mode 100644 index 0000000..b76d1e2 --- /dev/null +++ b/webdriver/java/AddPoolRaid0with2Disks.java @@ -0,0 +1,104 @@ +import java.io.File; +import java.io.FileInputStream; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.Select; // Dropdown menu +import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.support.ui.ExpectedConditions;// Explicit Waits +import org.openqa.selenium.support.ui.WebDriverWait; +import org.apache.commons.io.FileUtils; // Screenshots +import org.openqa.selenium.OutputType; +import org.openqa.selenium.TakesScreenshot; +import java.io.IOException; +import java.util.Properties; + + +public class AddPoolRaid0with2Disks { + + public static void main(String[] args) throws IOException { + // Create a new instance of the Firefox driver + + WebDriver driver = new FirefoxDriver(); + + try{ + + Properties prop = new Properties(); + prop.load(new FileInputStream("config.properties")); + driver.get(prop.getProperty("RockstorVm")); + + + + //User Login Input Forms + WebElement username = driver.findElement(By.id("inputUsername")); + username.sendKeys("admin"); + + WebElement password = driver.findElement(By.id("inputPassword")); + password.sendKeys("admin"); + + WebElement submit = driver.findElement(By.id("sign_in")); + submit.click(); + + // Select Pools from Navigation bar + WebElement poolsNav = driver.findElement(By.id("pools_nav")); + poolsNav.click(); + + //Explicit Wait for Pools page to load + WebElement myWaitElement1 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("add_pool"))); + + + WebElement addPool = driver.findElement(By.id("add_pool")); + addPool.click(); + + //Explicit Wait for CreatePools page. + WebElement myWaitlement2 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("create_pool"))); + + + WebElement poolname = driver.findElement(By.id("pool_name")); + poolname.sendKeys("pool1"); + + //Raid Configuration Dropdown box + Select raidConfigDroplist = new Select(driver.findElement(By.id("raid_level"))); + raidConfigDroplist.selectByIndex(0); + + //Select Disks CheckBox + WebElement diskCheckBox1 = driver.findElement(By.id("sdb")); + diskCheckBox1.click(); + WebElement diskCheckBox2 = driver.findElement(By.id("sdc")); + diskCheckBox2.click(); + + //Create Pool + WebElement createPool = driver.findElement(By.id("create_pool")); + createPool.click(); + + WebElement myWaitElement3 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("delete_pool_pool1"))); + } + + //catch any exceptions by taking screenshots. + catch(Exception e){ + + System.out.println(e.toString()); + + File screenshotFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); + FileUtils.copyFile(screenshotFile,new File("/home/priya/rockstor-tests/webdriver/java/ScreenShots/AddPool_Raid02Disks.png")); + + } + + //click on logout + WebElement logoutSubmit = driver.findElement(By.id("logout_user")); + + logoutSubmit.click(); + + } +} + + + + + + + + diff --git a/webdriver/java/AddPoolRaid0with5Disks.java b/webdriver/java/AddPoolRaid0with5Disks.java new file mode 100644 index 0000000..1514a15 --- /dev/null +++ b/webdriver/java/AddPoolRaid0with5Disks.java @@ -0,0 +1,111 @@ +import java.io.File; +import java.io.FileInputStream; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.Select; // Dropdown menu +import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.support.ui.ExpectedConditions;// Explicit Waits +import org.openqa.selenium.support.ui.WebDriverWait; +import org.apache.commons.io.FileUtils; // Screenshots +import org.openqa.selenium.OutputType; +import org.openqa.selenium.TakesScreenshot; +import java.io.IOException; +import java.util.Properties; + + +public class AddPoolRaid0with5Disks { + + public static void main(String[] args) throws IOException { + // Create a new instance of the Firefox driver + + WebDriver driver = new FirefoxDriver(); + + try{ + + Properties prop = new Properties(); + prop.load(new FileInputStream("config.properties")); + driver.get(prop.getProperty("RockstorVm")); + + + // User Login Input Forms + WebElement username = driver.findElement(By.id("inputUsername")); + username.sendKeys("admin"); + + WebElement password = driver.findElement(By.id("inputPassword")); + password.sendKeys("admin"); + + WebElement submit = driver.findElement(By.id("sign_in")); + submit.click(); + + // Select Pools from Navigation bar + WebElement poolsNav = driver.findElement(By.id("pools_nav")); + poolsNav.click(); + + //Explicit Wait for Pools page to load + WebElement myWaitElement1 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("add_pool"))); + + + WebElement addPool = driver.findElement(By.id("add_pool")); + addPool.click(); + + //Explicit Wait for CreatePools page. + WebElement myWaitElement2 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("create_pool"))); + + + WebElement poolname = driver.findElement(By.id("pool_name")); + poolname.sendKeys("pool1"); + + //Raid Configuration Dropdown box + Select raidConfigDroplist = new Select(driver.findElement(By.id("raid_level"))); + raidConfigDroplist.selectByIndex(0); + + //Select Disks CheckBox + WebElement diskCheckBox1 = driver.findElement(By.id("sdb")); + diskCheckBox1.click(); + WebElement diskCheckBox2 = driver.findElement(By.id("sdc")); + diskCheckBox2.click(); + WebElement diskCheckBox3 = driver.findElement(By.id("sdd")); + diskCheckBox3.click(); + WebElement diskCheckBox4 = driver.findElement(By.id("sde")); + diskCheckBox4.click(); + WebElement diskCheckBox5 = driver.findElement(By.id("sdf")); + diskCheckBox5.click(); + + + //Create Pool + WebElement createPool = driver.findElement(By.id("create_pool")); + createPool.click(); + + WebElement myWaitElement3 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("delete_pool_pool1"))); + } + + //catch any exceptions by taking screenshots. + catch(Exception e){ + + System.out.println(e.toString()); + + File screenshotFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); + FileUtils.copyFile(screenshotFile,new File("/home/priya/rockstor-tests/webdriver/java/ScreenShots/AddPool_Raid05Disks.png")); + + } + + //click on logout + WebElement logoutSubmit = driver.findElement(By.id("logout_user")); + + logoutSubmit.click(); + + } +} + + + + + + + + + diff --git a/webdriver/java/AddPoolRaid10with0Disks.java b/webdriver/java/AddPoolRaid10with0Disks.java new file mode 100644 index 0000000..204056a --- /dev/null +++ b/webdriver/java/AddPoolRaid10with0Disks.java @@ -0,0 +1,99 @@ +import java.io.File; +import java.io.FileInputStream; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.Select; // Dropdown menu +import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.support.ui.ExpectedConditions;// Explicit Waits +import org.openqa.selenium.support.ui.WebDriverWait; +import org.apache.commons.io.FileUtils; // Screenshots +import org.openqa.selenium.OutputType; +import org.openqa.selenium.TakesScreenshot; +import java.io.IOException; +import java.util.Properties; + + +public class AddPoolRaid10with0Disks { + + public static void main(String[] args) throws IOException { + // Create a new instance of the Firefox driver + + + WebDriver driver = new FirefoxDriver(); + + try{ + + Properties prop = new Properties(); + prop.load(new FileInputStream("config.properties")); + driver.get(prop.getProperty("RockstorVm")); + + + // User Login Input Forms + WebElement username = driver.findElement(By.id("inputUsername")); + username.sendKeys("admin"); + + WebElement password = driver.findElement(By.id("inputPassword")); + password.sendKeys("admin"); + + WebElement submit = driver.findElement(By.id("sign_in")); + submit.click(); + + // Select Pools from Navigation bar + WebElement poolsNav = driver.findElement(By.id("pools_nav")); + poolsNav.click(); + + //Explicit Wait for Pools page to load + WebElement myWaitElement1 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("add_pool"))); + + + WebElement addPool = driver.findElement(By.id("add_pool")); + addPool.click(); + + //Explicit Wait for CreatePools page. + WebElement myWaitElement2 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("create_pool"))); + + + WebElement poolname = driver.findElement(By.id("pool_name")); + poolname.sendKeys("pool1"); + + //Raid Configuration Dropdown box + Select raidConfigDroplist = new Select(driver.findElement(By.id("raid_level"))); + raidConfigDroplist.selectByIndex(2); + + //Create Pool + WebElement createPool = driver.findElement(By.id("create_pool")); + createPool.click(); + + WebElement myWaitElement3 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("delete_pool_pool1"))); + + } + + //catch any exceptions by taking screenshots. + catch(Exception e){ + + System.out.println(e.toString()); + + File screenshotFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); + FileUtils.copyFile(screenshotFile,new File("/home/priya/rockstor-tests/webdriver/java/ScreenShots/Raid10with0DiskPool.png")); + + } + + //click on logout + WebElement logoutSubmit = driver.findElement(By.id("logout_user")); + + logoutSubmit.click(); + + } +} + + + + + + + + diff --git a/webdriver/java/AddPoolRaid10with10Disks.java b/webdriver/java/AddPoolRaid10with10Disks.java new file mode 100644 index 0000000..96c2acc --- /dev/null +++ b/webdriver/java/AddPoolRaid10with10Disks.java @@ -0,0 +1,124 @@ +import java.io.File; +import java.io.FileInputStream; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.Select; // Dropdown menu +import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.support.ui.ExpectedConditions;// Explicit Waits +import org.openqa.selenium.support.ui.WebDriverWait; +import org.apache.commons.io.FileUtils; // Screenshots +import org.openqa.selenium.OutputType; +import org.openqa.selenium.TakesScreenshot; +import java.io.IOException; +import java.util.Properties; + + + + +public class AddPoolRaid10with10Disks { + + public static void main(String[] args) throws IOException { + // Create a new instance of the Firefox driver + + WebDriver driver = new FirefoxDriver(); + + try{ + + Properties prop = new Properties(); + prop.load(new FileInputStream("config.properties")); + driver.get(prop.getProperty("RockstorVm")); + + + // User Login Input Forms + WebElement username = driver.findElement(By.id("inputUsername")); + username.sendKeys("admin"); + + WebElement password = driver.findElement(By.id("inputPassword")); + password.sendKeys("admin"); + + WebElement submit = driver.findElement(By.id("sign_in")); + submit.click(); + + // Select Pools from Navigation bar + WebElement poolsNav = driver.findElement(By.id("pools_nav")); + poolsNav.click(); + + //Explicit Wait for Pools page to load + WebElement myWaitElement1 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("add_pool"))); + + + WebElement addPool = driver.findElement(By.id("add_pool")); + addPool.click(); + + //Explicit Wait for CreatePools page. + WebElement myWaitElement2 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("create_pool"))); + + + WebElement poolname = driver.findElement(By.id("pool_name")); + poolname.sendKeys("pool1"); + + //Raid Configuration Dropdown box + Select raidConfigDroplist = new Select(driver.findElement(By.id("raid_level"))); + raidConfigDroplist.selectByIndex(2); + + //Select Disks CheckBox + WebElement diskCheckBox1 = driver.findElement(By.id("sdb")); + diskCheckBox1.click(); + WebElement diskCheckBox2 = driver.findElement(By.id("sdc")); + diskCheckBox2.click(); + WebElement diskCheckBox3 = driver.findElement(By.id("sdd")); + diskCheckBox3.click(); + WebElement diskCheckBox4 = driver.findElement(By.id("sde")); + diskCheckBox4.click(); + WebElement diskCheckBox5 = driver.findElement(By.id("sdf")); + diskCheckBox5.click(); + WebElement diskCheckBox6 = driver.findElement(By.id("sdg")); + diskCheckBox6.click(); + WebElement diskCheckBox7 = driver.findElement(By.id("sdh")); + diskCheckBox7.click(); + WebElement diskCheckBox8 = driver.findElement(By.id("sdi")); + diskCheckBox8.click(); + WebElement diskCheckBox9 = driver.findElement(By.id("sdj")); + diskCheckBox9.click(); + WebElement diskCheckBox10 = driver.findElement(By.id("sdk")); + diskCheckBox10.click(); + + //Create Pool + WebElement createPool = driver.findElement(By.id("create_pool")); + createPool.click(); + + WebElement myWaitElement3 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("delete_pool_pool1"))); + } + + //catch any exceptions by taking screenshots + catch(Exception e){ + + System.out.println(e.toString()); + + File screenshotFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); + FileUtils.copyFile(screenshotFile,new File("/home/priya/rockstor-tests/webdriver/java/ScreenShots/AddPool_Raid104Disks.png")); + + } + + //click on logout + WebElement logoutSubmit = driver.findElement(By.id("logout_user")); + + logoutSubmit.click(); + + } +} + + + + + + + + + + + diff --git a/webdriver/java/AddPoolRaid10with3Disks.java b/webdriver/java/AddPoolRaid10with3Disks.java new file mode 100644 index 0000000..918068f --- /dev/null +++ b/webdriver/java/AddPoolRaid10with3Disks.java @@ -0,0 +1,108 @@ +import java.io.File; +import java.io.FileInputStream; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.Select; // Dropdown menu +import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.support.ui.ExpectedConditions;// Explicit Waits +import org.openqa.selenium.support.ui.WebDriverWait; +import org.apache.commons.io.FileUtils; // Screenshots +import org.openqa.selenium.OutputType; +import org.openqa.selenium.TakesScreenshot; +import java.io.IOException; +import java.util.Properties; + + +public class AddPoolRaid10with3Disks { + + public static void main(String[] args) throws IOException { + // Create a new instance of the Firefox driver + + + WebDriver driver = new FirefoxDriver(); + + try{ + + Properties prop = new Properties(); + prop.load(new FileInputStream("config.properties")); + driver.get(prop.getProperty("RockstorVm")); + + + // User Login Input Forms + WebElement username = driver.findElement(By.id("inputUsername")); + username.sendKeys("admin"); + + WebElement password = driver.findElement(By.id("inputPassword")); + password.sendKeys("admin"); + + WebElement submit = driver.findElement(By.id("sign_in")); + submit.click(); + + // Select Pools from Navigation bar + WebElement poolsNav = driver.findElement(By.id("pools_nav")); + poolsNav.click(); + + //Explicit Wait for Pools page to load + WebElement myWaitElement1 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("add_pool"))); + + + WebElement addPool = driver.findElement(By.id("add_pool")); + addPool.click(); + + //Explicit Wait for CreatePools page. + WebElement myWaitElement2 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("create_pool"))); + + + WebElement poolname = driver.findElement(By.id("pool_name")); + poolname.sendKeys("pool1"); + + //Raid Configuration Dropdown box + Select raidConfigDroplist = new Select(driver.findElement(By.id("raid_level"))); + raidConfigDroplist.selectByIndex(2); + + //Select Disks CheckBox + WebElement diskCheckBox1 = driver.findElement(By.id("sdb")); + diskCheckBox1.click(); + WebElement diskCheckBox2 = driver.findElement(By.id("sdc")); + diskCheckBox2.click(); + WebElement diskCheckBox3 = driver.findElement(By.id("sde")); + diskCheckBox3.click(); + + + //Create Pool + WebElement createPool = driver.findElement(By.id("create_pool")); + createPool.click(); + + WebElement myWaitElement3 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("delete_pool_pool1"))); + } + + //catch any exceptions by taking screenshots + catch(Exception e){ + + System.out.println(e.toString()); + + File screenshotFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); + FileUtils.copyFile(screenshotFile,new File("/home/priya/rockstor-tests/webdriver/java/ScreenShots/AddPool_Raid10With3Disks.png")); + + } + + //click on logout + WebElement logoutSubmit = driver.findElement(By.id("logout_user")); + + logoutSubmit.click(); + + } +} + + + + + + + + + diff --git a/webdriver/java/AddPoolRaid10with4Disks.java b/webdriver/java/AddPoolRaid10with4Disks.java new file mode 100644 index 0000000..957cf95 --- /dev/null +++ b/webdriver/java/AddPoolRaid10with4Disks.java @@ -0,0 +1,106 @@ +import java.io.File; +import java.io.FileInputStream; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.Select; // Dropdown menu +import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.support.ui.ExpectedConditions;// Explicit Waits +import org.openqa.selenium.support.ui.WebDriverWait; +import org.apache.commons.io.FileUtils; // Screenshots +import org.openqa.selenium.OutputType; +import org.openqa.selenium.TakesScreenshot; +import java.io.IOException; +import java.util.Properties; + + +public class AddPoolRaid10with4Disks { + + public static void main(String[] args) throws IOException { + // Create a new instance of the Firefox driver + + WebDriver driver = new FirefoxDriver(); + + try{ + Properties prop = new Properties(); + prop.load(new FileInputStream("config.properties")); + driver.get(prop.getProperty("RockstorVm")); + + //User Login Input Forms + WebElement username = driver.findElement(By.id("inputUsername")); + username.sendKeys("admin"); + + WebElement password = driver.findElement(By.id("inputPassword")); + password.sendKeys("admin"); + + WebElement submit = driver.findElement(By.id("sign_in")); + submit.click(); + + // Select Pools from Navigation bar + WebElement poolsNav = driver.findElement(By.id("pools_nav")); + poolsNav.click(); + + //Explicit Wait for Pools page to load + WebElement myWaitElement1 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("add_pool"))); + + + WebElement addPool = driver.findElement(By.id("add_pool")); + addPool.click(); + + //Explicit Wait for CreatePools page. + WebElement myWaitElement2 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("create_pool"))); + + + WebElement poolname = driver.findElement(By.id("pool_name")); + poolname.sendKeys("pool1"); + + //Raid Configuration Dropdown box + Select raidConfigDroplist = new Select(driver.findElement(By.id("raid_level"))); + raidConfigDroplist.selectByIndex(2); + + //Select Disks CheckBox + WebElement diskCheckBox1 = driver.findElement(By.id("sdb")); + diskCheckBox1.click(); + WebElement diskCheckBox2 = driver.findElement(By.id("sdc")); + diskCheckBox2.click(); + WebElement diskCheckBox3 = driver.findElement(By.id("sdd")); + diskCheckBox3.click(); + WebElement diskCheckBox4 = driver.findElement(By.id("sde")); + diskCheckBox4.click(); + + //Create Pool + WebElement createPool = driver.findElement(By.id("create_pool")); + createPool.click(); + + WebElement myWaitElement3 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("delete_pool_pool1"))); + } + + //catch any exceptions by taking screenshots + catch(Exception e){ + + System.out.println(e.toString()); + + File screenshotFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); + FileUtils.copyFile(screenshotFile,new File("/home/priya/rockstor-tests/webdriver/java/ScreenShots/AddPool_Raid104Disks.png")); + + } + + //click on logout + WebElement logoutSubmit = driver.findElement(By.id("logout_user")); + + logoutSubmit.click(); + + } +} + + + + + + + + + diff --git a/webdriver/java/AddPoolRaid1with0Disks.java b/webdriver/java/AddPoolRaid1with0Disks.java new file mode 100644 index 0000000..0185055 --- /dev/null +++ b/webdriver/java/AddPoolRaid1with0Disks.java @@ -0,0 +1,93 @@ +import java.io.File; +import java.io.FileInputStream; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.Select; // Dropdown menu +import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.support.ui.ExpectedConditions;// Explicit Waits +import org.openqa.selenium.support.ui.WebDriverWait; +import org.apache.commons.io.FileUtils; // Screenshots +import org.openqa.selenium.OutputType; +import org.openqa.selenium.TakesScreenshot; +import java.io.IOException; +import java.util.Properties; + + + +public class AddPoolRaid1with0Disks { + + public static void main(String[] args) throws IOException { + // Create a new instance of the Firefox driver + + WebDriver driver = new FirefoxDriver(); + + try{ + + Properties prop = new Properties(); + prop.load(new FileInputStream("config.properties")); + driver.get(prop.getProperty("RockstorVm")); + + + // Uer Login Input Forms + WebElement username = driver.findElement(By.id("inputUsername")); + username.sendKeys("admin"); + + WebElement password = driver.findElement(By.id("inputPassword")); + password.sendKeys("admin"); + + WebElement submit = driver.findElement(By.id("sign_in")); + submit.click(); + + // Select Pools from Navigation bar + WebElement poolsNav = driver.findElement(By.id("pools_nav")); + poolsNav.click(); + + //Explicit Wait for Pools page to load + WebElement myWaitElement1 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("add_pool"))); + + + WebElement addPool = driver.findElement(By.id("add_pool")); + addPool.click(); + + //Explicit Wait for CreatePools page. + WebElement myWaitElement2 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("create_pool"))); + + + WebElement poolname = driver.findElement(By.id("pool_name")); + poolname.sendKeys("pool1"); + + //Raid Configuration Dropdown box + Select raidConfigDroplist = new Select(driver.findElement(By.id("raid_level"))); + raidConfigDroplist.selectByIndex(1); + + //Create Pool + WebElement createPool = driver.findElement(By.id("create_pool")); + createPool.click(); + + WebElement myWaitElement3 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("delete_pool_pool1"))); + + } + + //catch any exceptions by taking screenshots + catch(Exception e){ + + System.out.println(e.toString()); + + File screenshotFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); + FileUtils.copyFile(screenshotFile,new File("/home/priya/rockstor-tests/webdriver/java/ScreenShots/Raid1with0DiskPool.png")); + + } + + //click on logout + WebElement logoutSubmit = driver.findElement(By.id("logout_user")); + + logoutSubmit.click(); + + } +} + + diff --git a/webdriver/java/AddPoolRaid1with1Disk.java b/webdriver/java/AddPoolRaid1with1Disk.java new file mode 100644 index 0000000..52e898e --- /dev/null +++ b/webdriver/java/AddPoolRaid1with1Disk.java @@ -0,0 +1,100 @@ +import java.io.File; +import java.io.FileInputStream; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.Select; // Dropdown menu +import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.support.ui.ExpectedConditions;// Explicit Waits +import org.openqa.selenium.support.ui.WebDriverWait; +import org.apache.commons.io.FileUtils; // Screenshots +import org.openqa.selenium.OutputType; +import org.openqa.selenium.TakesScreenshot; +import java.io.IOException; +import java.util.Properties; + + +public class AddPoolRaid1with1Disk { + + public static void main(String[] args) throws IOException { + // Create a new instance of the Firefox driver + + + WebDriver driver = new FirefoxDriver(); + + try{ + Properties prop = new Properties(); + prop.load(new FileInputStream("config.properties")); + driver.get(prop.getProperty("RockstorVm")); + + // User Login Input Forms + WebElement username = driver.findElement(By.id("inputUsername")); + username.sendKeys("admin"); + + WebElement password = driver.findElement(By.id("inputPassword")); + password.sendKeys("admin"); + + WebElement submit = driver.findElement(By.id("sign_in")); + submit.click(); + + // Select Pools from Navigation bar + WebElement poolsNav = driver.findElement(By.id("pools_nav")); + poolsNav.click(); + + //Explicit Wait for Pools page to load + WebElement myWaitElement1 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("add_pool"))); + + + WebElement addPool = driver.findElement(By.id("add_pool")); + addPool.click(); + + //Explicit Wait for CreatePools page. + WebElement myWaitElement2 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("create_pool"))); + + + WebElement poolname = driver.findElement(By.id("pool_name")); + poolname.sendKeys("pool1"); + + //Raid Configuration Dropdown box + Select raidConfigDroplist = new Select(driver.findElement(By.id("raid_level"))); + raidConfigDroplist.selectByIndex(1); + + //Select Disks CheckBox + WebElement diskCheckBox1 = driver.findElement(By.id("sdb")); + diskCheckBox1.click(); + + //Create Pool + WebElement createPool = driver.findElement(By.id("create_pool")); + createPool.click(); + + WebElement myWaitElement3 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("delete_pool_pool1"))); + } + + //catch any exceptions by taking screenshots + catch(Exception e){ + + System.out.println(e.toString()); + + File screenshotFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); + FileUtils.copyFile(screenshotFile,new File("/home/priya/rockstor-tests/webdriver/java/ScreenShots/1DiskRaid1Pool.png")); + + } + + //click on logout + WebElement logoutSubmit = driver.findElement(By.id("logout_user")); + + logoutSubmit.click(); + + } +} + + + + + + + + diff --git a/webdriver/java/AddPoolRaid1with2Disks.java b/webdriver/java/AddPoolRaid1with2Disks.java new file mode 100644 index 0000000..f96f4e7 --- /dev/null +++ b/webdriver/java/AddPoolRaid1with2Disks.java @@ -0,0 +1,103 @@ +import java.io.File; +import java.io.FileInputStream; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.Select; // Dropdown menu +import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.support.ui.ExpectedConditions;// Explicit Waits +import org.openqa.selenium.support.ui.WebDriverWait; +import org.apache.commons.io.FileUtils; // Screenshots +import org.openqa.selenium.OutputType; +import org.openqa.selenium.TakesScreenshot; +import java.io.IOException; +import java.util.Properties; + + +public class AddPoolRaid1with2Disks { + + public static void main(String[] args) throws IOException { + // Create a new instance of the Firefox driver + + WebDriver driver = new FirefoxDriver(); + + try{ + + Properties prop = new Properties(); + prop.load(new FileInputStream("config.properties")); + driver.get(prop.getProperty("RockstorVm")); + + + //User Login Input Forms + WebElement username = driver.findElement(By.id("inputUsername")); + username.sendKeys("admin"); + + WebElement password = driver.findElement(By.id("inputPassword")); + password.sendKeys("admin"); + + WebElement submit = driver.findElement(By.id("sign_in")); + submit.click(); + + // Select Pools from Navigation bar + WebElement poolsNav = driver.findElement(By.id("pools_nav")); + poolsNav.click(); + + //Explicit Wait for Pools page to load + WebElement myWaitElement1 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("add_pool"))); + + + WebElement addPool = driver.findElement(By.id("add_pool")); + addPool.click(); + + //Explicit Wait for CreatePools page. + WebElement myWaitElement2 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("create_pool"))); + + + WebElement poolname = driver.findElement(By.id("pool_name")); + poolname.sendKeys("pool1"); + + //Raid Configuration Dropdown box + Select raidConfigDroplist = new Select(driver.findElement(By.id("raid_level"))); + raidConfigDroplist.selectByIndex(1); + + //Select Disks CheckBox + WebElement diskCheckBox1 = driver.findElement(By.id("sdb")); + diskCheckBox1.click(); + WebElement diskCheckBox2 = driver.findElement(By.id("sdc")); + diskCheckBox2.click(); + + //Create Pool + WebElement createPool = driver.findElement(By.id("create_pool")); + createPool.click(); + + WebElement myWaitElement3 = (new WebDriverWait(driver, 30)) + .until(ExpectedConditions.elementToBeClickable(By.id("delete_pool_pool1"))); + } + + //catch any exceptions by taking screenshots + catch(Exception e){ + + System.out.println(e.toString()); + + File screenshotFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); + FileUtils.copyFile(screenshotFile,new File("/home/priya/rockstor-tests/webdriver/java/ScreenShots/AddPool_Raid12Disks.png")); + + } + + //click on logout + WebElement logoutSubmit = driver.findElement(By.id("logout_user")); + + logoutSubmit.click(); + + } +} + + + + + + + + diff --git a/webdriver/java/AddPoolRaid1with5Disks.java b/webdriver/java/AddPoolRaid1with5Disks.java new file mode 100644 index 0000000..e7eb3b9 --- /dev/null +++ b/webdriver/java/AddPoolRaid1with5Disks.java @@ -0,0 +1,111 @@ +import java.io.File; +import java.io.FileInputStream; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.Select; // Dropdown menu +import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.support.ui.ExpectedConditions;// Explicit Waits +import org.openqa.selenium.support.ui.WebDriverWait; +import org.apache.commons.io.FileUtils; // Screenshots +import org.openqa.selenium.OutputType; +import org.openqa.selenium.TakesScreenshot; +import java.io.IOException; +import java.util.Properties; + + +public class AddPoolRaid1with5Disks { + + public static void main(String[] args) throws IOException { + // Create a new instance of the Firefox driver + + WebDriver driver = new FirefoxDriver(); + + try{ + + Properties prop = new Properties(); + prop.load(new FileInputStream("config.properties")); + driver.get(prop.getProperty("RockstorVm")); + + + //User Login Input Forms + WebElement username = driver.findElement(By.id("inputUsername")); + username.sendKeys("admin"); + + WebElement password = driver.findElement(By.id("inputPassword")); + password.sendKeys("admin"); + + WebElement submit = driver.findElement(By.id("sign_in")); + submit.click(); + + // Select Pools from Navigation bar + WebElement poolsNav = driver.findElement(By.id("pools_nav")); + poolsNav.click(); + + //Explicit Wait for Pools page to load + WebElement myWaitElement1 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("add_pool"))); + + + WebElement addPool = driver.findElement(By.id("add_pool")); + addPool.click(); + + //Explicit Wait for CreatePools page. + WebElement myWaitElement2 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("create_pool"))); + + + WebElement poolname = driver.findElement(By.id("pool_name")); + poolname.sendKeys("pool1"); + + //Raid Configuration Dropdown box + Select raidConfigDroplist = new Select(driver.findElement(By.id("raid_level"))); + raidConfigDroplist.selectByIndex(1); + + //Select Disks CheckBox + WebElement diskCheckBox1 = driver.findElement(By.id("sdb")); + diskCheckBox1.click(); + WebElement diskCheckBox2 = driver.findElement(By.id("sdc")); + diskCheckBox2.click(); + WebElement diskCheckBox3 = driver.findElement(By.id("sdd")); + diskCheckBox3.click(); + WebElement diskCheckBox4 = driver.findElement(By.id("sde")); + diskCheckBox4.click(); + WebElement diskCheckBox5 = driver.findElement(By.id("sdf")); + diskCheckBox5.click(); + + + //Create Pool + WebElement createPool = driver.findElement(By.id("create_pool")); + createPool.click(); + + WebElement myWaitElement3 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("delete_pool_pool1"))); + } + + //catch any exceptions by taking screenshots + catch(Exception e){ + + System.out.println(e.toString()); + + File screenshotFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); + FileUtils.copyFile(screenshotFile,new File("/home/priya/rockstor-tests/webdriver/java/ScreenShots/AddPool_Raid15Disks.png")); + + } + + //click on logout + WebElement logoutSubmit = driver.findElement(By.id("logout_user")); + + logoutSubmit.click(); + + } +} + + + + + + + + + diff --git a/webdriver/java/GenericDeletePool.java b/webdriver/java/GenericDeletePool.java new file mode 100644 index 0000000..ea28032 --- /dev/null +++ b/webdriver/java/GenericDeletePool.java @@ -0,0 +1,76 @@ +import java.io.File; +import java.io.FileInputStream; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.Select; // Dropdown menu +import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.support.ui.ExpectedConditions;// Explicit Waits +import org.openqa.selenium.support.ui.WebDriverWait; +import org.apache.commons.io.FileUtils; // Screenshots +import org.openqa.selenium.OutputType; +import org.openqa.selenium.TakesScreenshot; +import java.io.IOException; +import java.util.Properties; + +public class GenericDeletePool{ + + public static void main(String[] args) throws IOException { + // Create a new instance of the Firefox driver + + WebDriver driver = new FirefoxDriver(); + + try{ + + Properties prop = new Properties(); + prop.load(new FileInputStream("config.properties")); + driver.get(prop.getProperty("RockstorVm")); + + + // User Login Input Forms + WebElement username = driver.findElement(By.id("inputUsername")); + username.sendKeys("admin"); + + WebElement password = driver.findElement(By.id("inputPassword")); + password.sendKeys("admin"); + + WebElement submit = driver.findElement(By.id("sign_in")); + submit.click(); + + // Select Pools from Navigation bar + WebElement poolsNav = driver.findElement(By.id("pools_nav")); + poolsNav.click(); + + //Explicit Wait for Pools page to load + WebElement myWaitElement1 = (new WebDriverWait(driver, 30)) + .until(ExpectedConditions.elementToBeClickable(By.id("delete_pool_pool1"))); + + //Delete Pool + WebElement deletePool = driver.findElement(By.id("delete_pool_pool1")); + deletePool.click(); + + //Wait until the normal pool page loads + WebElement myWaitElement2 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("create_pool"))); + } + + + //catch any exceptions by taking screenshots + catch(Exception e){ + + System.out.println(e.toString()); + + File screenshotFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); + FileUtils.copyFile(screenshotFile,new File("/home/priya/DelPool_Raid02Disks.png")); + + } + + //click on logout + WebElement logoutSubmit = driver.findElement(By.id("logout_user")); + + logoutSubmit.click(); + + } +} + + diff --git a/webdriver/java/LoginHappyPath.java b/webdriver/java/LoginHappyPath.java new file mode 100644 index 0000000..ef60c59 --- /dev/null +++ b/webdriver/java/LoginHappyPath.java @@ -0,0 +1,49 @@ + +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.support.ui.ExpectedCondition; +import org.openqa.selenium.support.ui.WebDriverWait; + +public class LoginHappyPath { + + public static void main(String[] args) { + // Create a new instance of the Firefox driver + // Notice that the remainder of the code relies on the interface, + // not the implementation. + WebDriver driver = new FirefoxDriver(); + + // And now use this to visit Google + driver.get("https://rockstor-iso:8443"); + // Alternatively the same thing can be done like this + // driver.navigate().to("http://www.google.com"); + + // Find the text input element by its name + WebElement username = driver.findElement(By.id("inputUsername")); + + // Enter something to search for + username.sendKeys("admin"); + + WebElement password = driver.findElement(By.id("inputPassword")); + password.sendKeys("admin"); + + WebElement submit = driver.findElement(By.id("sign_in")); + + // Now submit the form. WebDriver will find the form for us from the element + submit.click(); + + WebElement logoutSubmit = driver.findElement(By.id("logout_user")); + + logoutSubmit.click(); + + // Check the title of the page + System.out.println("Page title is: " + driver.getTitle()); + + //Close the browser + //driver.quit(); + } +} + + + diff --git a/webdriver/java/PoolResizeWith1Disk.java b/webdriver/java/PoolResizeWith1Disk.java new file mode 100644 index 0000000..7d18f7c --- /dev/null +++ b/webdriver/java/PoolResizeWith1Disk.java @@ -0,0 +1,135 @@ +import java.io.File; +import java.io.FileInputStream; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.Select; // Dropdown menu +import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.support.ui.ExpectedConditions;// Explicit Waits +import org.openqa.selenium.support.ui.WebDriverWait; +import org.apache.commons.io.FileUtils; // Screenshots +import org.openqa.selenium.OutputType; +import org.openqa.selenium.TakesScreenshot; +import java.io.IOException; +import java.util.Properties; + + +public class PoolResizeWith1Disk { + + public static void main(String[] args) throws IOException { + // Create a new instance of the Firefox driver + + WebDriver driver = new FirefoxDriver(); + + try{ + + Properties prop = new Properties(); + prop.load(new FileInputStream("config.properties")); + driver.get(prop.getProperty("RockstorVm")); + + + // User Login Input Forms + WebElement username = driver.findElement(By.id("inputUsername")); + username.sendKeys("admin"); + + WebElement password = driver.findElement(By.id("inputPassword")); + password.sendKeys("admin"); + + WebElement submit = driver.findElement(By.id("sign_in")); + submit.click(); + + // Select Pools from Navigation bar + WebElement poolsNav = driver.findElement(By.id("pools_nav")); + poolsNav.click(); + + //Explicit Wait for Pools page to load + WebElement myWaitElement1 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("add_pool"))); + + + WebElement addPool = driver.findElement(By.id("add_pool")); + addPool.click(); + + //Explicit Wait for CreatePools page. + WebElement myWaitElement2 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("create_pool"))); + + + WebElement poolname = driver.findElement(By.id("pool_name")); + poolname.sendKeys("pool1"); + + //Raid Configuration Dropdown box + Select raidConfigDroplist = new Select(driver.findElement(By.id("raid_level"))); + raidConfigDroplist.selectByIndex(0); + + //Select Disks CheckBox + WebElement diskCheckBox1 = driver.findElement(By.id("sdb")); + diskCheckBox1.click(); + WebElement diskCheckBox2 = driver.findElement(By.id("sdc")); + diskCheckBox2.click(); + + + //Create Pool + WebElement createPool = driver.findElement(By.id("create_pool")); + createPool.click(); + + WebElement myWaitElement3 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("delete_pool_pool1"))); + + WebElement poolLink = driver.findElement(By.linkText("pool1")); + poolLink.click(); + + + WebElement myWaitElement4 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("resize-pool-popup"))); + + WebElement resizeButton = driver.findElement(By.id("resize-pool-popup")); + resizeButton.click(); + + + WebElement myWaitElement5 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("disks-table"))); + + + WebElement resizeSubmitButton = driver.findElement(By.id("resize-pool")); + resizeSubmitButton.click(); + + WebElement myWaitElement6 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("resize-pool-popup"))); + + WebElement disksNav = driver.findElement(By.id("disks_nav")); + disksNav.click(); + + WebElement myWaitElement7 = (new WebDriverWait(driver, 10)) + .until(ExpectedConditions.elementToBeClickable(By.id("disks-table"))); + + File screenshotFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); + FileUtils.copyFile(screenshotFile,new File("/home/priya/rockstor-tests/webdriver/java/ScreenShots/PoolsResize_DisksPage.png")); + + } + //catch any exceptions by taking screenshots + catch(Exception e){ + + System.out.println(e.toString()); + + File screenshotFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); + FileUtils.copyFile(screenshotFile,new File("/home/priya/rockstor-tests/webdriver/java/ScreenShots/PoolResize_0Disks.png")); + + } + + //click on logout + WebElement logoutSubmit = driver.findElement(By.id("logout_user")); + + logoutSubmit.click(); + + } +} + + + + + + + + + diff --git a/webdriver/java/config.properties b/webdriver/java/config.properties new file mode 100644 index 0000000..2dfb2ad --- /dev/null +++ b/webdriver/java/config.properties @@ -0,0 +1 @@ +RockstorVm=https\://sujeetsr.com diff --git a/webdriver/java/pom.xml b/webdriver/java/pom.xml new file mode 100644 index 0000000..a0b4768 --- /dev/null +++ b/webdriver/java/pom.xml @@ -0,0 +1,36 @@ + + + 4.0.0 + MySel20Proj + MySel20Proj + 1.0 + + + org.seleniumhq.selenium + selenium-java + 2.33.0 + + + com.opera + operadriver + + + + + + com.opera + operadriver + 1.3 + + + org.seleniumhq.selenium + selenium-remote-driver + + + + + + + diff --git a/webdriver/java/target/MySel20Proj-1.0.jar b/webdriver/java/target/MySel20Proj-1.0.jar new file mode 100644 index 0000000..e34fa93 Binary files /dev/null and b/webdriver/java/target/MySel20Proj-1.0.jar differ diff --git a/webdriver/java/target/classes/.classpath b/webdriver/java/target/classes/.classpath new file mode 100644 index 0000000..76cc564 --- /dev/null +++ b/webdriver/java/target/classes/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/webdriver/java/target/classes/.project b/webdriver/java/target/classes/.project new file mode 100644 index 0000000..caf4c59 --- /dev/null +++ b/webdriver/java/target/classes/.project @@ -0,0 +1,23 @@ + + + MySel20Proj + NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.jdt.core.javanature + + diff --git a/webdriver/java/target/classes/.settings/org.eclipse.jdt.core.prefs b/webdriver/java/target/classes/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..e18b690 --- /dev/null +++ b/webdriver/java/target/classes/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,6 @@ +#Thu May 23 16:10:27 PDT 2013 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/webdriver/java/target/classes/.settings/org.eclipse.m2e.core.prefs b/webdriver/java/target/classes/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..eeafa3f --- /dev/null +++ b/webdriver/java/target/classes/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,5 @@ +#Thu May 23 16:10:20 PDT 2013 +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/webdriver/java/target/classes/pom.xml b/webdriver/java/target/classes/pom.xml new file mode 100644 index 0000000..a0b4768 --- /dev/null +++ b/webdriver/java/target/classes/pom.xml @@ -0,0 +1,36 @@ + + + 4.0.0 + MySel20Proj + MySel20Proj + 1.0 + + + org.seleniumhq.selenium + selenium-java + 2.33.0 + + + com.opera + operadriver + + + + + + com.opera + operadriver + 1.3 + + + org.seleniumhq.selenium + selenium-remote-driver + + + + + + + diff --git a/webdriver/java/target/classes/target/MySel20Proj-1.0.jar b/webdriver/java/target/classes/target/MySel20Proj-1.0.jar new file mode 100644 index 0000000..e34fa93 Binary files /dev/null and b/webdriver/java/target/classes/target/MySel20Proj-1.0.jar differ diff --git a/webdriver/java/target/classes/target/maven-archiver/pom.properties b/webdriver/java/target/classes/target/maven-archiver/pom.properties new file mode 100644 index 0000000..bf3bb75 --- /dev/null +++ b/webdriver/java/target/classes/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu May 23 16:07:22 PDT 2013 +version=1.0 +groupId=MySel20Proj +artifactId=MySel20Proj diff --git a/webdriver/java/target/maven-archiver/pom.properties b/webdriver/java/target/maven-archiver/pom.properties new file mode 100644 index 0000000..bf3bb75 --- /dev/null +++ b/webdriver/java/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu May 23 16:07:22 PDT 2013 +version=1.0 +groupId=MySel20Proj +artifactId=MySel20Proj