quality assurance project
Sashin Pradhan 04/19/2016 Quality Assurance & Testing
Automation Test Plan - Spirit.com
1. Test Plan Identifier. a. Spirit Website Release 1.0 MTP 0.9
2. Introduction/Test Objective a. In order to be competitive in the cheap flight searching
industry, Spirit’s owners feel that their website needs to be in top notch state to be able to provide their customers with utmost satisfaction. Their website needs to be perfect since that is the only way for Spirit to work.
This project’s goal is to check almost all functions of the website and see if there are any errors. The target audience will be an example of client going through their website via computer and clicking different links and see if they work and function well. Testing will consist of Code Quality Assurance, System load level, System Quality & Acceptance.
3. Test Items a. The scope of this Testing activity will include:
i. Firefox based, script for all pages for the website 1. check if page refreshes 2. check home button while in any page 3. check if pressing big “Spirit” logo takes to home
page 4. check all links 5. check scroll function 6. check if booking flights, cars, and hotel works, all
together and individually 7. check log in 8. check Flight Status drop downs and functionality 9. check drop downs for booking flights, arrivals and
destinations, also check for null value in “Adults”
10. check if texts/design changes accordingly to the window zoom in/zoom out function
4. Test Strategy. a. For each of the Testing functions above, we will be using
Selenium IDE in Firefox to check if they work as needed.
5. Tools. a. The main automation tool we will be using is Selenium IDE
Firefox.
6. Environment. a. The philosophy of the testing is risk-based testing, each case
will be prioritized as High, Medium, or Low priority then tested accordingly, Highest first.
b. The test environment setup we will need is: i. Firefox browser ii. Internet connection iii.Selenium IDE add-on
7. Test Data.
a. Open <www.spirit.com>
i. check if page refreshes 1. click refresh button while in all pages to see if the
page reloads ii. check home button while in any page
1. click the home button from any page and check if it take you to the homepage
iii.check if pressing big “Spirit” logo takes you to homepage
1. check if all pages has the “Spirit” logo, and see if clicking that logo takes you to homepage
iv. check all links 1. check if all links on the pages work or gives you
error message, click home button when done v. check scroll function
1. scroll up and down and check if scroll function works, click home button when done
vi. check if booking flights, cars, and hotel works 1. click Flight and check for flights and valid prices/
dates, click home button
2. click “Flight + Car” and check for prices/dates and options, click home button
3. click “Flight + Hotel”, and check for prices/dates/ and other options, click home button
4. click “Flight + Hotel + Car”, check for prices/ dates/ and other option, click home button when done
5. click “Hotel” and check for errors, click home button
6. click “Car” and check for errors, click home button 7. click “Cruise”, check for errors, click home button
when done vii.check log in
1. made a fake profile, check if log in feature works, click home button
viii. Check flight status drop down and functionality 1. click on flight status and check for drop downs and
random arrival/destination status. check for errors. click home button when done
ix. Check drop down for flight bookings/ null values 1. click on Flight 2. check drop down menu for “From” & “To” 3. Select “0 adults” in ADULTS section and “Search
Flights”, check for errors
x. check if texts/design changes accordingly to the window zoom in/zoom out function
1. on any page, click “Zoom in” “Zoom out” through Firefox menu
2. check for errors/ design flaws
8. Risks and Assumptions. a. Risks: Testing is risk-based and is prioritized in the following
category: i. High
1. meaning, requires testing first and is the most important
ii. Medium 1. can have a significant issue if fail, but also not too
important iii.Low
1. probably stable and does not affect the program as much
b. Assumptions: We are assuming all the Test elements listed above to be at the highest priority. We are going to try to test each one of them unless there are problems, such as time and financial issues.
9. Reports: a. While performing the automation test, I came across many
small errors & big errors as well. i. While looking for “Home” button in different pages of
the websites, in some pages, the home button link was missing so had to click the “Spirit” logo to take back to Home.
ii. While running the automation test, searching for flight, each time I ran the test on same departure and arrival, each time, it gave me a different time and prices, sometimes same time but different prices.
iii.Also, while searching for hotels and rental cars, it gave me different prices for each time I did the automation test search
iv. While trying to pass “0 adults” in passenger section of Flights, it gave me an error and would not go past that stage until I chose a value from the drop down menu.
v. Almost half the time I ran the automation test, it gave me an error “Could not find Home button” even if the home button was on the page
vi. sometimes the test times out after 3000 ms
10.Integrations/scheduling a. No continuos plan needed if all the test elements above are
tested without error b. If more time is left over and financially supported, test buying
a mock ticket online i. Use Selenium in firefox ii. Buy a mock ticket through Spirit website and check for
errors
TEST SCRIPT:
package test;
import java.util.regex.Pattern; import java.util.concurrent.TimeUnit; import org.junit.*; import static org.junit.Assert.*; import static org.hamcrest.CoreMatchers.*; import org.openqa.selenium.*; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.support.ui.Select; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runners.Parameterized.Parameters;
public class SpiritTest { private WebDriver driver; private String baseUrl; private boolean acceptNextAlert = true; private StringBuffer verificationErrors = new StringBuffer();
private String[] ClickNext = {"Home", "Spirit"}; @Before public void setUp1() throws Exception { driver = new FirefoxDriver(); baseUrl = "https://www.spirit.com/"; driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); }
@Test public void testCase15() throws Exception {
for (int index=0; index < ClickNext.length; index++) { driver.findElement(By.linkText("Optional Services")).click(); driver.findElement(By.linkText("Home")).click(); driver.get(baseUrl + "/"); driver.findElement(By.cssSelector("a[title=\"Spirit Airlines \"]")).click(); driver.findElement(By.linkText("Deals")).click(); driver.findElement(By.cssSelector("a[title=\"Spirit Airlines \"]")).click(); driver.findElement(By.linkText("$9 Fare Club")).click(); driver.findElement(By.linkText("Home")).click(); driver.findElement(By.linkText("New Bag Prices")).click(); driver.findElement(By.cssSelector("a[title=\"Spirit Airlines \"]")).click(); driver.findElement(By.linkText("Where we Fly")).click(); driver.findElement(By.cssSelector("a[title=\"Spirit Airlines \"]")).click(); driver.findElement(By.linkText("New Bag Prices")).click(); driver.findElement(By.cssSelector("a[title=\"Spirit Airlines \"]")).click(); driver.findElement(By.linkText("About Us")).click(); driver.findElement(By.linkText("Home")).click();
} } @After public void tearDown1() throws Exception { driver.quit(); String verificationErrorString = verificationErrors.toString(); if (!"".equals(verificationErrorString)) { fail(verificationErrorString); } }
private boolean isElementPresent1(By by) { try { driver.findElement(by); return true; } catch (NoSuchElementException e) { return false; }
}
private boolean isAlertPresent1() { try { driver.switchTo().alert(); return true; } catch (NoAlertPresentException e) { return false; } }
private String closeAlertAndGetItsText1() { try { Alert alert = driver.switchTo().alert(); String alertText = alert.getText(); if (acceptNextAlert) { alert.accept(); } else { alert.dismiss(); } return alertText; } finally { acceptNextAlert = true; } }
@Before public void setUp() throws Exception { driver = new FirefoxDriver(); baseUrl = "https://www.spirit.com/"; driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); }
@Test public void testCase510() throws Exception {
for (int index=0; index < ClickNext.length; index++) { driver.get(baseUrl + "/Default.aspx#book-travel"); driver.findElement(By.id("flightOnlyWidgetOptions")).click(); driver.findElement(By.id("journeyRoundTrip")).click(); new Select(driver.findElement(By.id("departCityCodeSelect"))).selectByVisi bleText("Boston, MA (BOS)");
new Select(driver.findElement(By.id("destCityCodeSelect"))).selectByVisibl eText("Detroit, MI (DTW)"); driver.findElement(By.cssSelector("img.ui-datepicker- trigger")).click(); driver.findElement(By.linkText("22")).click(); driver.findElement(By.id("returnDate")).click(); driver.findElement(By.linkText("24")).click(); driver.findElement(By.xpath("//button[@type='submit']")).click(); driver.findElement(By.linkText("Home")).click(); driver.findElement(By.linkText("<– – Show All")).click(); driver.findElement(By.id("flightCarWidgetOptions")).click(); driver.findElement(By.id("journeyRoundTrip")).click(); new Select(driver.findElement(By.id("departCityCodeSelect"))).selectByVisi bleText("Atlanta, GA (ATL)"); new Select(driver.findElement(By.id("destCityCodeSelect"))).selectByVisibl eText("Boston, MA (BOS)"); driver.findElement(By.xpath("//button[@type='submit']")).click(); driver.findElement(By.linkText("Home")).click(); driver.findElement(By.linkText("<– – Show All")).click(); driver.findElement(By.id("flightHotelWidgetOptions")).click(); driver.findElement(By.id("journeyRoundTrip")).click(); new Select(driver.findElement(By.id("departCityCodeSelect"))).selectByVisi bleText("Cleveland, OH (CLE)"); new Select(driver.findElement(By.id("destCityCodeSelect"))).selectByVisibl eText("Oakland, CA / San Francisco, CA AREA (OAK)"); driver.findElement(By.xpath("//button[@type='submit']")).click(); driver.findElement(By.cssSelector("a[title=\"Spirit Airlines \"]")).click(); driver.findElement(By.linkText("<– – Show All")).click(); driver.findElement(By.cssSelector("#flightHotelCarWidgetOptions > span.linkVerbiage")).click(); driver.findElement(By.id("journeyRoundTrip")).click(); new Select(driver.findElement(By.id("departCityCodeSelect"))).selectByVisi bleText("Cleveland, OH (CLE)"); new Select(driver.findElement(By.id("destCityCodeSelect"))).selectByVisibl eText("Los Angeles, CA (LAX)");
driver.findElement(By.xpath("//button[@type='submit']")).click(); driver.findElement(By.cssSelector("a[title=\"Spirit Airlines \"]")).click(); driver.findElement(By.linkText("<– – Show All")).click(); driver.findElement(By.id("loginlink")).click(); driver.findElement(By.id("emailField")).clear(); driver.findElement(By.id("emailField")).sendKeys("sashinpradhan@gmail. com"); driver.findElement(By.cssSelector("#login > p.actions > button.button.primary")).click(); driver.findElement(By.id("passwordField")).clear(); driver.findElement(By.id("passwordField")).sendKeys("sashin110"); driver.findElement(By.cssSelector("#login > p.actions > button.button.primary")).click(); driver.findElement(By.linkText("FLIGHT STATUS")).click(); new Select(driver.findElement(By.id("statusDepartCitySelect"))).selectByVi sibleText("Denver, CO (DEN)"); new Select(driver.findElement(By.id("statusDestCitySelect"))).selectByVisi bleText("Houston, TX - Intercontinental (IAH)"); driver.findElement(By.xpath("(//button[@type='submit']) [3]")).click(); driver.findElement(By.linkText("Home")).click(); driver.findElement(By.linkText("<– – Show All")).click(); driver.findElement(By.id("flightOnlyWidgetOptions")).click(); driver.findElement(By.id("journeyRoundTrip")).click(); new Select(driver.findElement(By.id("departCityCodeSelect"))).selectByVisi bleText("Bogota, Colombia (BOG)"); new Select(driver.findElement(By.id("departCityCodeSelect"))).selectByVisi bleText("Aruba, Aruba (AUA)"); new Select(driver.findElement(By.id("destCityCodeSelect"))).selectByVisibl eText("Atlanta, GA (ATL)"); new Select(driver.findElement(By.id("departCityCodeSelect"))).selectByVisi bleText("Atlanta, GA (ATL)"); new Select(driver.findElement(By.id("destCityCodeSelect"))).selectByVisibl eText("Boston, MA (BOS)");
new Select(driver.findElement(By.id("paxAdults"))).selectByVisibleText("0 adults"); driver.findElement(By.xpath("//button[@type='submit']")).click(); driver.findElement(By.xpath("//div[5]/div/a/span")).click();
} }
@After public void tearDown() throws Exception { driver.quit(); String verificationErrorString = verificationErrors.toString(); if (!"".equals(verificationErrorString)) { fail(verificationErrorString); } }
private boolean isElementPresent(By by) { try { driver.findElement(by); return true; } catch (NoSuchElementException e) { return false; } }
private boolean isAlertPresent() { try { driver.switchTo().alert(); return true; } catch (NoAlertPresentException e) { return false; } }
private String closeAlertAndGetItsText() { try { Alert alert = driver.switchTo().alert(); String alertText = alert.getText(); if (acceptNextAlert) { alert.accept(); } else { alert.dismiss();
} return alertText; } finally { acceptNextAlert = true; } }
}