From e3154bd2b748ec1d30892911703ea2834dff1384 Mon Sep 17 00:00:00 2001 From: Krunoslav Zaher Date: Sun, 13 Mar 2016 16:21:14 +0100 Subject: [PATCH] Fixes automation tests. --- .../TableViewWithEditingCommandsViewController.swift | 7 ++++++- scripts/automation-tests/03_masterDetail.js | 8 +++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/RxExample/RxExample/Examples/TableViewWithEditingCommands/TableViewWithEditingCommandsViewController.swift b/RxExample/RxExample/Examples/TableViewWithEditingCommands/TableViewWithEditingCommandsViewController.swift index ec514266..02cecd91 100644 --- a/RxExample/RxExample/Examples/TableViewWithEditingCommands/TableViewWithEditingCommandsViewController.swift +++ b/RxExample/RxExample/Examples/TableViewWithEditingCommands/TableViewWithEditingCommandsViewController.swift @@ -70,11 +70,16 @@ class TableViewWithEditingCommandsViewController: ViewController, UITableViewDel imageURL: "http://nerdreactor.com/wp-content/uploads/2015/02/Superman1.jpg" ) + let watMan = User(firstName: "Wat", + lastName: "Man", + imageURL: "http://www.iri.upc.edu/files/project/98/main.GIF" + ) + let loadFavoriteUsers = RandomUserAPI.sharedAPI .getExampleUserResultSet() .map(TableViewEditingCommand.SetUsers) - let initialLoadCommand = Observable.just(TableViewEditingCommand.SetFavoriteUsers(favoriteUsers: [superMan])) + let initialLoadCommand = Observable.just(TableViewEditingCommand.SetFavoriteUsers(favoriteUsers: [superMan, watMan])) .concat(loadFavoriteUsers) .observeOn(MainScheduler.instance) diff --git a/scripts/automation-tests/03_masterDetail.js b/scripts/automation-tests/03_masterDetail.js index 9e5b5483..c46ed1fa 100644 --- a/scripts/automation-tests/03_masterDetail.js +++ b/scripts/automation-tests/03_masterDetail.js @@ -8,21 +8,23 @@ test("----- masterDetail -----", function (check, pass) { var target = UIATarget.localTarget() + target.delay(2) + target.frontMostApp().mainWindow().tableViews()[0].cells()[10].tap(); target.frontMostApp().navigationBar().rightButton().tap(); target.frontMostApp().mainWindow().dragInsideWithOptions({startOffset:{x:0.93, y:yOffset(300)}, endOffset:{x:0.95, y:yOffset(200)}, duration:1.5}); target.frontMostApp().mainWindow().dragInsideWithOptions({startOffset:{x:0.93, y:yOffset(300)}, endOffset:{x:0.95, y:yOffset(100)}, duration:1.5}); - var firstCell = UIATarget.localTarget().frontMostApp().mainWindow().tableViews()[0].cells()[1] + var firstCell = UIATarget.localTarget().frontMostApp().mainWindow().tableViews()[0].cells()[0] - firstCell.buttons()[0].tap(); + firstCell.tapWithOptions({tapOffset:{x:0.05, y:0.77}}); firstCell.buttons()["Delete"].tap(); target.delay( 3 ); target.frontMostApp().navigationBar().rightButton().tap(); - target.frontMostApp().mainWindow().tableViews()[0].cells()[1].tap(); + target.frontMostApp().mainWindow().tableViews()[0].cells()[0].tap(); goBack(); goBack();