This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| setUserCookie(); // will obtain unique user and inject cookie into browser | |
| TDMUtils.setCart({ | |
| creditCardAlwaysPass: 0, | |
| item: "Samsung S8" | |
| }); | |
| CartPage.visit(); | |
| CartPage.checkOut(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import unittest | |
| from appium import webdriver | |
| class TestClass(unittest.TestCase): | |
| def setUp(self): | |
| caps = {} | |
| caps['browserName'] = "" | |
| caps['appiumVersion'] = "1.6" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DesiredCapabilities capabilities = new DesiredCapabilities(); | |
| // set desired capabilities to launch appropriate browser on Sauce | |
| capabilities.setCapability(CapabilityType.BROWSER_NAME, "firefox"); | |
| capabilities.setCapability(CapabilityType.VERSION, "latest"); | |
| capabilities.setCapability(CapabilityType.PLATFORM, "Windows 7"); | |
| capabilities.setCapability("name", "sample test name"); | |
| FirefoxProfile firefoxProfile = new FirefoxProfile(); | |
| firefoxProfile.setPreference("extensions.blocklist.enabled", false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rspec' | |
| require 'capybara/rspec' | |
| require 'appium_capybara' | |
| Capybara.register_driver(:appium) do |app| | |
| opts = {:caps=>{:platformName=>"ios", :deviceName=>"iPad Air Simulator", :platformVersion=>"9.3", :browserName=>"Safari"}, :appium_lib=>{:sauce_username=>"YOUR_SAUCE_USERNAME", :sauce_access_key=>"YOUR_SAUCE_ACCESS_KEY"}} | |
| Appium::Capybara::Driver.new app, opts | |
| end | |
| Capybara.default_driver = :appium |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rspec' | |
| require 'capybara/rspec' | |
| require 'appium_capybara' | |
| Capybara.register_driver(:appium) do |app| | |
| opts = { | |
| :caps => { | |
| :platformName=>"ios", | |
| :deviceName=>"iPad Air Simulator", | |
| :platformVersion=>"9.3", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Test | |
| public void verifyCommentInputTest() throws InvalidElementStateException { | |
| long startTime = System.nanoTime(); | |
| for (int i = 1; i < 3; i++) { | |
| WebElement x = driver.findElementByAccessibilityId("TextField1"); | |
| x.clear(); | |
| x.sendKeys("12"); | |
| x = driver.findElementByAccessibilityId("TextField2"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| file_name = ARGV[0] | |
| proposed_name = ARGV[1] || file_name.gsub(' ', '_') | |
| `curl -u #{ENV['SAUCE_USERNAME']}:#{ENV['SAUCE_ACCESS_KEY']} \ | |
| -X POST \ | |
| -H "Content-Type: application/octet-stream" \ | |
| https://saucelabs.com/rest/v1/storage/#{ENV['SAUCE_USERNAME']}/#{proposed_name}?overwrite=true \ | |
| --data-binary @'#{file_name}'` | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| before(:each) do | test | | |
| browser = Selenium::WebDriver.for(:remote, :url => 'https://ondemand.saucelabs.com:443/wd/hub', { :browserName => 'chrome' }) | |
| end | |
| it 'this is my test' do | |
| browser.get('http://www.yahoo.com') | |
| browser.element(:id => 'abc').click() | |
| assertTrue(browser.element('def').visible?) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import os | |
| write_file = 'C:\Users\Administrator\Downloads\zzz.log' | |
| w_file = open(write_file, 'w') | |
| w_file.write('testing\n') | |
| w_file.close() | |
| while True: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| while false do | |
| if file.exists? then | |
| content = read(file) | |
| if content == 'delete file/folder x' then | |
| # delete file/folder x | |
| elsif content == 'install plugin y' then | |
| # install plugin y, or call script that will install plugin y | |
| elsif content == 'some other thing' | |
| # insert other commands as needed |