Skip to content

TTN-23587 minimal changes to get the tests running #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ build-iPhoneSimulator/
/vendor/bundle
/lib/bundler/man/


# for a library or gem, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# Gemfile.lock
Expand All @@ -54,3 +55,6 @@ build-iPhoneSimulator/

# Used by RuboCop. Remote config files pulled in from inherit_from directive.
# .rubocop-https?--*
.idea/
.ds_store
.DS_Store
11 changes: 6 additions & 5 deletions android/examples/Gemfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
source 'http://rubygems.org'
source 'https://rubygems.org'

gem 'cucumber'
gem 'cucumber', '~> 3.1.2'
gem 'selenium-cucumber'
gem 'selenium-webdriver', '~> 3.142', '>= 3.142.5'
gem 'rspec'
gem 'selenium-webdriver', '< 4.0'
gem 'rspec', '~> 3.12'
gem 'rake'
gem 'parallel_tests'
gem 'appium_lib'
gem 'appium_lib', '~> 11.0'
gem 'dotenv', '~> 2.8'
126 changes: 58 additions & 68 deletions android/examples/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,105 +1,95 @@
GEM
remote: http://rubygems.org/
remote: https://rubygems.org/
specs:
appium_lib (12.0.1)
appium_lib_core (~> 5.0)
appium_lib (11.2.0)
appium_lib_core (~> 4.1)
nokogiri (~> 1.8, >= 1.8.1)
tomlrb (>= 1.1, < 3.0)
appium_lib_core (5.3.0)
tomlrb (~> 1.1)
appium_lib_core (4.7.1)
faye-websocket (~> 0.11.0)
selenium-webdriver (~> 4.2, < 4.5)
builder (3.2.4)
childprocess (4.1.0)
selenium-webdriver (~> 3.14, >= 3.14.1)
backports (3.25.1)
base64 (0.2.0)
builder (3.3.0)
childprocess (3.0.0)
chunky_png (1.4.0)
cucumber (8.0.0)
builder (~> 3.2, >= 3.2.4)
cucumber-ci-environment (~> 9.0, >= 9.0.4)
cucumber-core (~> 11.0, >= 11.0.0)
cucumber-cucumber-expressions (~> 15.1, >= 15.1.1)
cucumber-gherkin (~> 23.0, >= 23.0.1)
cucumber-html-formatter (~> 19.1, >= 19.1.0)
cucumber-messages (~> 18.0, >= 18.0.0)
diff-lcs (~> 1.5, >= 1.5.0)
mime-types (~> 3.4, >= 3.4.1)
multi_test (~> 1.1, >= 1.1.0)
sys-uname (~> 1.2, >= 1.2.2)
cucumber-ci-environment (9.1.0)
cucumber-core (11.0.0)
cucumber-gherkin (~> 23.0, >= 23.0.1)
cucumber-messages (~> 18.0, >= 18.0.0)
cucumber-tag-expressions (~> 4.1, >= 4.1.0)
cucumber-cucumber-expressions (15.2.0)
cucumber-gherkin (23.0.1)
cucumber-messages (~> 18.0, >= 18.0.0)
cucumber-html-formatter (19.2.0)
cucumber-messages (~> 18.0, >= 18.0.0)
cucumber-messages (18.0.0)
cucumber-tag-expressions (4.1.0)
cucumber (3.1.2)
builder (>= 2.1.2)
cucumber-core (~> 3.2.0)
cucumber-expressions (~> 6.0.1)
cucumber-wire (~> 0.0.1)
diff-lcs (~> 1.3)
gherkin (~> 5.1.0)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.2)
cucumber-core (3.2.1)
backports (>= 3.8.0)
cucumber-tag_expressions (~> 1.1.0)
gherkin (~> 5.0)
cucumber-expressions (6.0.1)
cucumber-tag_expressions (1.1.1)
cucumber-wire (0.0.1)
diff-lcs (1.5.0)
dotenv (2.8.1)
eventmachine (1.2.7)
faye-websocket (0.11.1)
faye-websocket (0.11.4)
eventmachine (>= 0.12.0)
websocket-driver (>= 0.5.1)
ffi (1.15.5)
mime-types (3.4.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2022.0105)
websocket-driver (>= 0.5.1, < 0.8.0)
gherkin (5.1.0)
multi_json (1.15.0)
multi_test (1.1.0)
nokogiri (1.13.8-arm64-darwin)
nokogiri (1.18.8-arm64-darwin)
racc (~> 1.4)
nokogiri (1.13.8-x86_64-darwin)
nokogiri (1.18.8-x86_64-darwin)
racc (~> 1.4)
parallel (1.22.1)
parallel_tests (3.12.0)
parallel
racc (1.6.0)
racc (1.8.1)
rake (13.0.6)
rexml (3.2.5)
rspec (3.11.0)
rspec-core (~> 3.11.0)
rspec-expectations (~> 3.11.0)
rspec-mocks (~> 3.11.0)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.0)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.3)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.4)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-mocks (3.11.1)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.4)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-support (3.11.0)
rubyzip (2.3.2)
rspec-support (~> 3.13.0)
rspec-support (3.13.3)
rubyzip (2.4.1)
selenium-cucumber (3.1.5)
appium_lib (>= 8.0.2)
chunky_png (>= 1.3.5)
cucumber (>= 2.3.0)
rspec (>= 3.4.0)
selenium-webdriver (>= 2.53.0)
selenium-webdriver (4.4.0)
childprocess (>= 0.5, < 5.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sys-uname (1.2.2)
ffi (~> 1.1)
tomlrb (2.0.3)
websocket (1.2.9)
websocket-driver (0.7.5)
selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
tomlrb (1.3.0)
websocket-driver (0.7.7)
base64
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)

PLATFORMS
arm64-darwin-21
arm64-darwin-24
x86_64-darwin-21

DEPENDENCIES
appium_lib
cucumber
appium_lib (~> 11.0)
cucumber (~> 3.1.2)
dotenv (~> 2.8)
parallel_tests
rake
rspec
rspec (~> 3.12)
selenium-cucumber
selenium-webdriver
selenium-webdriver (< 4.0)

BUNDLED WITH
2.3.21
83 changes: 26 additions & 57 deletions android/examples/run-first-test/features/support/env.rb
Original file line number Diff line number Diff line change
@@ -1,76 +1,45 @@
require 'yaml'
require 'rspec'
require 'selenium-cucumber'

require 'appium_lib'

TASK_ID = (ENV['TASK_ID'] || 0).to_i
CONFIG_NAME = ENV['CONFIG_NAME'] || 'first'

CONFIG = YAML.load(File.read(File.join(File.dirname(__FILE__), "../../config/#{CONFIG_NAME}.config.yml")))

@caps = CONFIG['common_caps'].merge(CONFIG['browser_caps'][TASK_ID])


#$bs_local = nil


puts @caps.inspect

us= @caps["user"].inspect
ak= @caps["key"].inspect
is= @caps["isRealMobile"].inspect
pl= @caps["platform"].inspect
dn= @caps["deviceName"].inspect
pv= @caps["platformVersion"].inspect
ap= @caps["app"].inspect



user= us.gsub("\"", "")
accessKey=ak.gsub("\"", "")
isRealMobile= is.gsub("\"", "")
platform= pl.gsub("\"", "")
deviceName= dn.gsub("\"", "")
platformVersion= pv.gsub("\"", "")
app= ap.gsub("\"", "")
puts isRealMobile


caps={

"LT:Options" => {

"build" => "Cucumber Android Single",
"name" => "Cucumber Sample Test",
"platformName" => platform,
"isRealMobile" => isRealMobile,
"deviceName" => deviceName,
"platformVersion" => platformVersion,
"app" => app,
"w3c" => true

},


username = ENV["LT_USERNAME"] || "YOUR_LT_USERNAME"
accessToken = ENV["LT_ACCESS_KEY"] || "YOUR_LT_ACCESS_KEY"

caps = {
"lt:options" => {
:deviceName => "Galaxy S21 5G",
:platformName => "Android",
:platformVersion => "11",
:build => "Ruby Cucumber - Android single",
:name => "Ruby Android Test",
:isRealMobile => true,
:queueTimeout => 300,
:app => "YOUR_ANDROID_APP_ID",
:w3c => true,
:autoGrantPermissions => true
},
:platformName => "Android"
}


appium_driver = Appium::Driver.new({
'caps' => caps,
'appium_lib' => {
:server_url => "https://#{CONFIG['user']}:#{CONFIG['key']}@#{CONFIG['server']}/wd/hub"
#server_url: "https://webhook.site/5958677a-4db9-4253-bb76-5b98e97e4880"
}}, true)


'caps' => caps,
'appium_lib' => {
:server_url => "https://#{username}:#{accessToken}@mobile-hub.lambdatest.com/wd/hub"
}
}, true)

begin
#$appium_driver = Appium::Driver.new(desired_caps, true)
$driver = appium_driver.start_driver
#example.run
ensure
#$driver.quit
rescue => e
puts "Error starting driver: #{e.message}"
puts "Capabilities used: #{caps.inspect}"
raise e
end


Loading