我已经成功安装了Appium,并更新了以下ruby gems:
$ gem update --system $ gem update bundler
并为ruby安装了以下gem:
gem uninstall -aIx appium_lib gem install --no-rdoc --no-ri appium_lib
这是我的第一次红宝石测试:
require 'rubygems'
require 'appium_lib'
APP_PATH = appAddress
desired_caps = {
caps: {
platformName: iOS,
platformVersion: 11.4,
deviceName: iPhone 7,
app: APP_PATH,
automationName: XCUITest,
},
appium_lib: {
sauce_username: nil,
sauce_access_key: nil,
wait: 60
}
}
# Start the driver
Appium::Driver.new(desired_caps, true).start_driver
module DataSiteOne
module iOS
#prints statement
puts "Entered into this test!"
#Quit when you're done!
driver_quit
puts "First Tests Succeeded!"
end
end
我从终端启动appium然后运行我的第一个ruby测试后收到以下错误消息。
require 'rubygems'
^^^^^^^^^^
SyntaxError: Unexpected string
at new Script (vm.js:74:7)
at createScript (vm.js:246:10)
at Object.runInThisContext (vm.js:298:10)
at Module._compile (internal/modules/cjs/loader.js:670:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:744:10)
at startup (internal/bootstrap/node.js:238:19)
答案 0 :(得分:0)
最初我用javascript编写了测试,因此我使用了以下命令:
节点"您的项目名称"
在终端启动appium后,运行以下命令运行ruby测试文件: ruby" fileName"