Skip to content

Instantly share code, notes, and snippets.

View Alona-T's full-sized avatar

Alona Alona-T

  • Vancouver
  • 15:15 (UTC -07:00)
View GitHub Profile
require 'appium_lib'
username = 'User Name from Browserstack'
access_key = 'Access Key from Browserstack'
case ENV['SERVER']
when 'LOCAL'
case ENV['PLATFORM']
when 'ANDROID'
case ENV['DEVICE_NAME']
case ENV['SERVER']
when 'LOCAL'
.................
when 'BROWSERSTACK'
case ENV['PLATFORM']
when 'ANDROID'
case ENV['DEVICE_NAME']
when "SamsungS10E"
caps = {}
require 'rake'
require 'json'
require 'cucumber/rake/task'
task :ios_browserstack, [:device] do |_task, args|
device = args.device
ENV['DEVICE_NAME'] = device
ENV['SERVER'] = 'BROWSERSTACK'
puts "<< Device #{device} >>"
@Alona-T
Alona-T / swipe.rb
Last active June 2, 2020 22:04
Swipe methods that can be used regardless mobile device model and screen size. Using element's coordinates in the method helps to archive it
#swipe to top
def swipe_to_top(element, duration)
elem = element
x = elem.location.x
y = elem.location.y
Appium::TouchAction.swipe(start_x: x, start_y: y, duration: duration)
end
#when you need to just horizontally swipe carousel of elements or similar (when 2 elements are present)
def swipe_horizontally(element_s, element_e, duration)
@Alona-T
Alona-T / bitbucket.yaml
Created August 13, 2023 04:33
Pushing allure report to bitbucket page in bitbucket.yaml file
pipelines:
custom:
run-tests:
- step:
name: Run api dev
image: ubuntu:22.04
script:
- cd tests
- apt update
- apt remove -y nodejs