Revert "Create session and basic interactions samples (#9907)" (#9915)

This reverts commit 061e264800.
This commit is contained in:
Dan Graham
2018-01-04 13:52:30 -08:00
committed by GitHub
parent 061e264800
commit 36cc935fc5
21 changed files with 1 additions and 281 deletions

View File

@@ -1,35 +0,0 @@
import wd from 'wd';
import chai from 'chai';
import { iosCaps, androidCaps, serverConfig } from '../helpers/caps';
const {assert} = chai;
describe('Create Android session', function () {
it('should create and destroy Android sessions', async function () {
// Connect to Appium server
const driver = await wd.promiseChainRemote(serverConfig);
// We haven't started a session yet, so we shouldn't see any sessions running
assert.equal((await driver.sessions()).length, 0);
// Start the session
await driver.init({
...androidCaps,
app: require('../helpers/apps').androidApiDemos
});
// Now that session is running, check that 'sessions' length is one
assert.equal((await driver.sessions()).length, 1);
// Check that we're running the ApiDemos app by checking package and activity
const activity = await driver.getCurrentActivity();
const pkg = await driver.getCurrentPackage();
assert.equal(`${pkg}${activity}`, 'io.appium.android.apis.ApiDemos');
// Quit the session
await driver.quit();
// Session is closed, so we should be back to having no sessions
assert.equal((await driver.sessions()).length, 0);
});
});

View File

@@ -1,28 +0,0 @@
import wd from 'wd';
import chai from 'chai';
import { androidCaps, serverConfig } from '../helpers/caps';
const {assert} = chai;
describe('Create Chrome web session', function () {
it('should create and destroy Android browser session', async function () {
// Connect to Appium server
const driver = await wd.promiseChainRemote(serverConfig);
// Start the session
await driver.init({
...androidCaps,
browserName: 'Chrome'
});
// Navigate to google.com
await driver.get('https://www.google.com');
// Test that it was successful by checking the document title
const pageTitle = await driver.title();
assert.equal(pageTitle, 'Google');
// Quit the session
await driver.quit();
});
});

View File

@@ -1,60 +0,0 @@
import wd from 'wd';
import chai from 'chai';
import { iosCaps, serverConfig } from '../helpers/caps';
const {assert} = chai;
describe('Basic IOS interactions', function () {
let driver;
before(async function () {
// Connect to Appium server
driver = await wd.promiseChainRemote(serverConfig);
// Start the session
await driver.init({
...iosCaps,
app: require('../helpers/apps').iosTestApp
});
});
after(async function () {
await driver.quit();
});
it('should send keys to inputs', async function () {
// Find TextField input element
const textInputId = `TextField1`;
await driver.waitForElementByAccessibilityId(textInputId);
const textViewsEl = await driver.elementByAccessibilityId(textInputId);
// Check that it doesn't have a value
let value = await textViewsEl.getValue();
assert.isNull(value, 'Input should have no value');
// Send keys to that input
await textViewsEl.sendKeys('Hello World!');
// Check that the input has new value
value = await textViewsEl.getValue();
assert.equal(value, 'Hello World!', 'Input should have newly input value');
});
it('should click a button that opens an alert', async function () {
// Find Button element and click on it
const buttonElementId = `show alert`;
await driver.waitForElementByAccessibilityId(buttonElementId);
const buttonElement = await driver.elementByAccessibilityId(buttonElementId);
await buttonElement.click();
// Wait for the alert to show up
const alertTitleId = `Cool title`;
await driver.waitForElementByAccessibilityId(alertTitleId);
const alertTitleElement = await driver.elementByAccessibilityId(alertTitleId);
// Check the text
const alertTitle = await alertTitleElement.text();
assert.equal(alertTitle, `Cool title`);
});
});

View File

@@ -1,35 +0,0 @@
import wd from 'wd';
import chai from 'chai';
import { iosCaps, serverConfig } from '../helpers/caps';
const {assert} = chai;
describe('Create session', function () {
it('should create and destroy IOS sessions', async function () {
// Connect to Appium server
const driver = await wd.promiseChainRemote(serverConfig);
// We haven't started a session yet, so we shouldn't see any sessions running
assert.equal((await driver.sessions()).length, 0);
// Start the session
await driver.init({
...iosCaps,
app: require('../helpers/apps').iosTestApp
});
// Now that session is running, check that 'sessions' length is one
assert.equal((await driver.sessions()).length, 1);
// Check that the XCUIElementTypeApplication was what we expect it to be
const applicationElement = await driver.elementByClassName('XCUIElementTypeApplication');
const applicationName = await applicationElement.getAttribute('name');
assert.equal(applicationName, 'TestApp');
// Quit the session
await driver.quit();
// Session is closed, so we should be back to having no sessions
assert.equal((await driver.sessions()).length, 0);
});
});

View File

@@ -1,28 +0,0 @@
import wd from 'wd';
import chai from 'chai';
import { iosCaps, serverConfig } from '../helpers/caps';
const {assert} = chai;
describe('Create Safari session', function () {
it('should create and destroy IOS Safari session', async function () {
// Connect to Appium server
const driver = await wd.promiseChainRemote(serverConfig);
// Start the session
await driver.init({
...iosCaps,
browserName: 'Safari'
});
// Navigate to google.com
await driver.get('https://www.google.com');
// Test that it was successful by checking the document title
const pageTitle = await driver.title();
assert.equal(pageTitle, 'Google');
// Quit the session
await driver.quit();
});
});