public void PlaceBusInX1Y2EastPositionThenMoveAndRotateAndMoveAgainAndReport() { // Step 1: [Setup] Load the landing page var singlePage = SinglePage <TWebDriver> .NewInstance(); singlePage.LoadPage(); // Step 2: Place the bus in the carpark at the initial coordinate X1Y2 and face east string xString = "1"; string yString = "2"; string direction = "east"; singlePage.SelectXAndYCoordinates(xString, yString); singlePage.SelectDirection(direction); // TODO: Create Enum for directions and pass x and y values in to create locator rather than hard-coding it singlePage.ClickPlaceBusButton(SinglePage <TWebDriver> .CoordinateX1Y2Locator, SinglePage <TWebDriver> .East); // Step 3: Move one unit east SinglePage <TWebDriver> .GetInstance().Move(); // Step 4: Move one unit east again SinglePage <TWebDriver> .GetInstance().Move(); // Step 5: Rotate bus to the left SinglePage <TWebDriver> .GetInstance().RotateBusToLeft(); // Step 5: Move one unit north SinglePage <TWebDriver> .GetInstance().Move(); // Step 6: Report generated SinglePage <TWebDriver> .GetInstance().Report(3, 3, "North"); }
public void PlaceBusInDefaultPositionThenMoveAndReport() { // Step 1: [Setup] Load the landing page new PlaceBus <TWebDriver>().PlaceBusInDefaultPosition(); // Step 2: Move one unit SinglePage <TWebDriver> .GetInstance().Move(); // Step 3: Report generated SinglePage <TWebDriver> .GetInstance().Report(0, 1, "North"); }
// All browser windows associated with the driver are closed and the session safely ended after each test public void Quit() { SinglePage<TWebDriver>.GetInstance().QuitDriver(); }
public void BusCantExitCarpark() { // Step 1: [Setup] Load the landing page var singlePage = SinglePage <TWebDriver> .NewInstance(); singlePage.LoadPage(); // Step 2: Place the bus in the 0,0 (x,y) position in the carpark, facing north singlePage.ClickPlaceBusButton(SinglePage <TWebDriver> .CoordinateX0Y0Locator, SinglePage <TWebDriver> .North); // Step 3: Move 5 positions north from starting position SinglePage <TWebDriver> .GetInstance().Move(); SinglePage <TWebDriver> .GetInstance().Move(); SinglePage <TWebDriver> .GetInstance().Move(); SinglePage <TWebDriver> .GetInstance().Move(); SinglePage <TWebDriver> .GetInstance().Move(); // TODO: Remove hard-coding from x,y co-ordinate and direction locator // Step 4: Check that the bus is located in the 4,4 (x,y) position of the carpark, facing east singlePage.CheckBusIsInCorrectPosition(SinglePage <TWebDriver> .CoordinateX0Y4Locator, SinglePage <TWebDriver> .North); // Step 5: Rotate the bus right and then move 5 positions east SinglePage <TWebDriver> .GetInstance().RotateBusToRight(); SinglePage <TWebDriver> .GetInstance().Move(); SinglePage <TWebDriver> .GetInstance().Move(); SinglePage <TWebDriver> .GetInstance().Move(); SinglePage <TWebDriver> .GetInstance().Move(); SinglePage <TWebDriver> .GetInstance().Move(); // Step 6: Check that the bus is located in the 4,4 (x,y) position of the carpark, facing east singlePage.CheckBusIsInCorrectPosition(SinglePage <TWebDriver> .CoordinateX4Y4Locator, SinglePage <TWebDriver> .East); // Step 7: Rotate the bus right and then move 5 positions south // BUG: Unable to move bus south at all from the 4,4 x,y co-ordinate position (manually or via automated test) SinglePage <TWebDriver> .GetInstance().RotateBusToRight(); // TODO: Create loop for repeated functions SinglePage <TWebDriver> .GetInstance().Move(); SinglePage <TWebDriver> .GetInstance().Move(); SinglePage <TWebDriver> .GetInstance().Move(); SinglePage <TWebDriver> .GetInstance().Move(); SinglePage <TWebDriver> .GetInstance().Move(); // Step 8: Check that the bus is located in the 4,0 (x,y) position of the carpark, facing east SinglePage <TWebDriver> .GetInstance() .CheckBusIsInCorrectPosition(SinglePage <TWebDriver> .CoordinateX4Y0Locator, SinglePage <TWebDriver> .South); // Step 9: Rotate the bus right and then move 5 positions west SinglePage <TWebDriver> .GetInstance().RotateBusToRight(); SinglePage <TWebDriver> .GetInstance().Move(); SinglePage <TWebDriver> .GetInstance().Move(); SinglePage <TWebDriver> .GetInstance().Move(); SinglePage <TWebDriver> .GetInstance().Move(); SinglePage <TWebDriver> .GetInstance().Move(); // Step 10: Check that the bus is located in the 0,0 (x,y) position of the carpark, facing west SinglePage <TWebDriver> .GetInstance() .CheckBusIsInCorrectPosition(SinglePage <TWebDriver> .CoordinateX0Y0Locator, SinglePage <TWebDriver> .West); // Step 11: Rotate the bus right and then move 1 position north SinglePage <TWebDriver> .GetInstance().RotateBusToRight(); SinglePage <TWebDriver> .GetInstance().Move(); // Step 12: Check that the bus is located in the 0,1 (x,y) position of the carpark, facing north SinglePage <TWebDriver> .GetInstance() .CheckBusIsInCorrectPosition(SinglePage <TWebDriver> .CoordinateX0Y1Locator, SinglePage <TWebDriver> .North); }