                     
                     print("Adding scenario '\(currentName)' with \(currentSteps.count) steps.")
                     
-                    returnArray.addObject(scenario)
+                    returnArray.add(scenario)
                     currentSteps.removeAll()
                 }
                 
                 // ...and start a new scenario
-                currentName = testStep.substringFromIndex(testStep.startIndex.advancedBy(10))
+                currentName = String(testStep.suffix(from: testStep.index(testStep.startIndex, offsetBy: 10)))
                 print("Found start of test scenario '\(currentName)'")
                 continue
             }

            if (testStep.hasPrefix("Scenario: ")) {
                
                // are we currently building a scenario?
                if (currentName.characters.count > 0) {
                    // then finish the current scenario...
                    let scenario = Scenario()
                    scenario.scenarioName = currentName;

                
                if (parameterNames.count == 1) {
                    if let selectorString = dict[key] {
                        self.perform(Selector.init("\(selectorString):\(parameterNames[0]):"), with: app, with: parameterValues[0])
                        return true
                    }
                }
