mirror of
https://github.com/appium/appium.git
synced 2026-05-03 17:00:32 -05:00
update all examples to use correct desired caps
we don't want people getting confused!
This commit is contained in:
@@ -19,9 +19,9 @@ namespace SimpleTest
|
||||
// set up the remote web driver
|
||||
Console.WriteLine("Connecting to Appium server");
|
||||
DesiredCapabilities capabilities = new DesiredCapabilities();
|
||||
capabilities.SetCapability("browserName", "iOS");
|
||||
capabilities.SetCapability("platform", "Mac");
|
||||
capabilities.SetCapability("version", "6.0");
|
||||
capabilities.SetCapability("browserName", "");
|
||||
capabilities.SetCapability("platform", "MAC");
|
||||
capabilities.SetCapability("version", "6.1");
|
||||
capabilities.SetCapability("app", appPath);
|
||||
RemoteWebDriver driver = new RemoteWebDriver(new Uri("http://127.0.0.1:4723/wd/hub"), capabilities);
|
||||
|
||||
|
||||
@@ -47,7 +47,8 @@ public class SauceTest {
|
||||
String sauceUserName = System.getenv("SAUCE_USER_NAME");
|
||||
String sauceAccessKey = System.getenv("SAUCE_USER_NAME");
|
||||
DesiredCapabilities capabilities = new DesiredCapabilities();
|
||||
capabilities.setCapability(CapabilityType.BROWSER_NAME, "iOS 6.0");
|
||||
capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
|
||||
capabilities.setCapability(CapabilityType.VERSION, "6.0");
|
||||
capabilities.setCapability("device", "iPhone Simulator");
|
||||
capabilities.setCapability(CapabilityType.PLATFORM, "Mac 10.8");
|
||||
capabilities.setCapability("app", "http://appium.s3.amazonaws.com/TestApp6.0.app.zip");
|
||||
|
||||
@@ -60,9 +60,10 @@ public class SimpleTest {
|
||||
File appDir = new File(System.getProperty("user.dir"), "../../../apps/TestApp/build/Release-iphonesimulator");
|
||||
File app = new File(appDir, "TestApp.app");
|
||||
DesiredCapabilities capabilities = new DesiredCapabilities();
|
||||
capabilities.setCapability(CapabilityType.BROWSER_NAME, "iOS");
|
||||
capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
|
||||
capabilities.setCapability(CapabilityType.VERSION, "6.0");
|
||||
capabilities.setCapability(CapabilityType.PLATFORM, "Mac");
|
||||
capabilities.setCapability("device", "iPhone Simulator");
|
||||
capabilities.setCapability("app", app.getAbsolutePath());
|
||||
driver = new SwipeableWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
|
||||
values = new ArrayList<Integer>();
|
||||
@@ -95,7 +96,7 @@ public class SimpleTest {
|
||||
WebElement texts = driver.findElement(By.tagName("staticText"));
|
||||
assertEquals(texts.getText(), String.valueOf(values.get(0) + values.get(1)));
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testActive() throws Exception {
|
||||
WebElement text = driver.findElement(By.xpath("//textfield[1]"));
|
||||
|
||||
+3
-2
@@ -43,9 +43,10 @@ public class UICatalogTest {
|
||||
File appDir = new File(classpathRoot, "../../../apps/UICatalog/build/Release-iphonesimulator");
|
||||
File app = new File(appDir, "UICatalog.app");
|
||||
DesiredCapabilities capabilities = new DesiredCapabilities();
|
||||
capabilities.setCapability(CapabilityType.BROWSER_NAME, "iOS");
|
||||
capabilities.setCapability(CapabilityType.VERSION, "6.0");
|
||||
capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
|
||||
capabilities.setCapability(CapabilityType.VERSION, "6.1");
|
||||
capabilities.setCapability(CapabilityType.PLATFORM, "Mac");
|
||||
capabilities.setCapability("device", "iPhone Simulator");
|
||||
capabilities.setCapability("app", app.getAbsolutePath());
|
||||
driver = new SwipeableWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ browser
|
||||
, name: "Appium Hybrid App: with WD"
|
||||
, platform:'Mac 10.8'
|
||||
, app: appURL
|
||||
, version: ''
|
||||
, version: '6.0'
|
||||
, browserName: ''
|
||||
})
|
||||
.windowHandles(function(err, handles) {
|
||||
|
||||
@@ -23,7 +23,7 @@ browser
|
||||
, platform: "Mac"
|
||||
, app: appURL
|
||||
, version: "6.0"
|
||||
, browserName: "iOS"
|
||||
, browserName: ""
|
||||
, newCommandTimeout: 60
|
||||
})
|
||||
.elementsByTagName("textField", function(err, els) {
|
||||
|
||||
@@ -18,7 +18,7 @@ var desired = {
|
||||
, name: "Appium: Sync WD"
|
||||
, platform:'Mac 10.8'
|
||||
, app: appURL
|
||||
, version: ''
|
||||
, version: '6.1'
|
||||
, browserName: ''
|
||||
};
|
||||
|
||||
|
||||
@@ -30,19 +30,6 @@ var scrollToElement = o_O(function*(element) {
|
||||
}
|
||||
});
|
||||
|
||||
// Buttons, Various uses of UIButton
|
||||
// Controls, Various uses of UIControl
|
||||
// TextFields, Uses of UITextField
|
||||
// SearchBar, Use of UISearchBar
|
||||
// TextView, Use of UITextField
|
||||
// Pickers, Uses of UIDatePicker, UIPickerView
|
||||
// Images, Use of UIImageView
|
||||
// Web, Use of UIWebView
|
||||
// Segments, Various uses of UISegmentedControl
|
||||
// Toolbar, Uses of UIToolbar
|
||||
// Alerts, Various uses of UIAlertView, UIActionSheet
|
||||
// Transitions, Shows UIViewAnimationTransitions
|
||||
|
||||
driver.run(function*() {
|
||||
try {
|
||||
yield this.init(desiredCaps);
|
||||
|
||||
@@ -18,7 +18,7 @@ class SauceTest extends Sauce\Sausage\WebDriverTestCase
|
||||
'platform' => 'Mac 10.8',
|
||||
'device' => 'iPhone Simulator',
|
||||
'app' => APP_URL,
|
||||
'version' => '',
|
||||
'version' => '6.1',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -18,8 +18,9 @@ class SimpleTest extends Sauce\Sausage\WebDriverTestCase
|
||||
array(
|
||||
'local' => true,
|
||||
'port' => 4723,
|
||||
'browserName' => 'iOS',
|
||||
'browserName' => '',
|
||||
'desiredCapabilities' => array(
|
||||
'device' => 'iPhone Simulator',
|
||||
'version' => '6.0',
|
||||
'platform' => 'Mac',
|
||||
'app' => APP_PATH
|
||||
|
||||
@@ -26,9 +26,10 @@ class TestSequenceFunctions(unittest.TestCase):
|
||||
self.driver = webdriver.Remote(
|
||||
command_executor='http://%s:%s@ondemand.saucelabs.com:80/wd/hub' % (SAUCE_USERNAME, SAUCE_ACCESS_KEY),
|
||||
desired_capabilities={
|
||||
'browserName': 'iOS 6.0',
|
||||
'browserName': '',
|
||||
'platform': 'Mac 10.8',
|
||||
'device': 'iPhone Simulator',
|
||||
'version': '6.1',
|
||||
'app': app
|
||||
})
|
||||
self._values = []
|
||||
@@ -40,7 +41,7 @@ class TestSequenceFunctions(unittest.TestCase):
|
||||
rndNum = randint(0, 10)
|
||||
elem.send_keys(rndNum)
|
||||
self._values.append(rndNum)
|
||||
|
||||
|
||||
def _set_test_status(self, jobid, passed=True):
|
||||
# Report the status of your test to Sauce
|
||||
body_content = json.dumps({"passed": passed})
|
||||
|
||||
@@ -21,7 +21,8 @@ class TestSequenceFunctions(unittest.TestCase):
|
||||
self.driver = webdriver.Remote(
|
||||
command_executor='http://127.0.0.1:4723/wd/hub',
|
||||
desired_capabilities={
|
||||
'browserName': 'iOS',
|
||||
'browserName': '',
|
||||
'device': 'iPhone Simulator',
|
||||
'platform': 'Mac',
|
||||
'version': '6.0',
|
||||
'app': app
|
||||
|
||||
@@ -18,7 +18,8 @@ class TestSequenceFunctions(unittest.TestCase):
|
||||
self.driver = webdriver.Remote(
|
||||
command_executor='http://127.0.0.1:4723/wd/hub',
|
||||
desired_capabilities={
|
||||
'browserName': 'iOS',
|
||||
'browserName': '',
|
||||
'device': 'iPhone Simulator',
|
||||
'platform': 'Mac',
|
||||
'version': '6.0',
|
||||
'app': app
|
||||
|
||||
@@ -32,7 +32,8 @@ class TestSequenceFunctions(unittest.TestCase):
|
||||
self.driver = webdriver.Remote(
|
||||
command_executor='http://127.0.0.1:4723/wd/hub',
|
||||
desired_capabilities={
|
||||
'browserName': 'iOS',
|
||||
'browserName': '',
|
||||
'device': 'iPhone Simulator',
|
||||
'platform': 'Mac',
|
||||
'version': '6.0',
|
||||
'app': app
|
||||
@@ -57,7 +58,7 @@ class TestSequenceFunctions(unittest.TestCase):
|
||||
# there is nav bar inside the app
|
||||
nav_bar = self.driver.find_element_by_tag_name("navigationBar")
|
||||
self.assertTrue(nav_bar)
|
||||
|
||||
|
||||
def test_frames(self):
|
||||
table = self.driver.find_element_by_tag_name("tableView")
|
||||
self._open_menu_position(7)
|
||||
@@ -66,7 +67,7 @@ class TestSequenceFunctions(unittest.TestCase):
|
||||
#find the URL field
|
||||
textfield = self.driver.find_element_by_name("URL entry")
|
||||
self.assertEqual(textfield.get_attribute("value"), "http://www.apple.com")
|
||||
|
||||
|
||||
textfield.find_element_by_tag_name("button").click()
|
||||
# send www.google.com and press the Go button (\n)
|
||||
textfield.send_keys("http://www.google.com\\n")
|
||||
@@ -105,7 +106,7 @@ class TestSequenceFunctions(unittest.TestCase):
|
||||
self.assertTrue(segmented_control.is_displayed())
|
||||
# row is from previous view, should not be visible
|
||||
self.assertTrue(self._row.is_displayed())
|
||||
|
||||
|
||||
#verify the text is what we expect
|
||||
tinted_text = self.driver.find_elements_by_tag_name("text")[4]
|
||||
self.assertEqual(tinted_text.text, "UISegmentControlStyleBar: (tinted)")
|
||||
@@ -117,7 +118,7 @@ class TestSequenceFunctions(unittest.TestCase):
|
||||
self.assertEquals(tinted_buttons[0].get_attribute("value"), '')
|
||||
self.assertEquals(tinted_buttons[1].get_attribute("value"), '1')
|
||||
self.assertEquals(tinted_buttons[2].get_attribute("value"), '')
|
||||
|
||||
|
||||
def test_text_field_edit(self):
|
||||
# go to the text fields section
|
||||
self._open_menu_position(2)
|
||||
|
||||
@@ -16,8 +16,9 @@ APP_PATH = '../../../../../apps/TestApp/build/release-iphonesimulator/TestApp.ap
|
||||
# What we need as a capability --> iOS device, where our app is, ect.
|
||||
def capabilities
|
||||
{
|
||||
'browserName' => 'iOS',
|
||||
'browserName' => '',
|
||||
'platform' => 'Mac',
|
||||
'device' => 'iPhone Simulator',
|
||||
'version' => '6.0',
|
||||
'app' => absolute_app_path
|
||||
}
|
||||
|
||||
@@ -48,8 +48,9 @@ end
|
||||
|
||||
def capabilities
|
||||
{
|
||||
'browserName' => 'iOS 6.0',
|
||||
'browserName' => '',
|
||||
'platform' => 'Mac 10.8',
|
||||
'version' => '6.1',
|
||||
'device' => 'iPhone Simulator',
|
||||
'app' => APP_PATH,
|
||||
'name' => 'Ruby Example for Appium',
|
||||
|
||||
@@ -41,8 +41,9 @@ def absolute_app_path
|
||||
end
|
||||
|
||||
capabilities = {
|
||||
'browserName' => 'iOS',
|
||||
'browserName' => '',
|
||||
'platform' => 'Mac',
|
||||
'device' => 'iPhone Simulator',
|
||||
'version' => '6.0',
|
||||
'app' => absolute_app_path
|
||||
}
|
||||
|
||||
@@ -17,8 +17,9 @@ APP_PATH = '../../apps/UICatalog/build/Release-iphonesimulator/UICatalog.app'
|
||||
|
||||
def capabilities
|
||||
{
|
||||
'browserName' => 'iOS',
|
||||
'browserName' => '',
|
||||
'platform' => 'Mac',
|
||||
'device' => 'iPhone Simulator',
|
||||
'version' => '6.0',
|
||||
'app' => absolute_app_path
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user