Bez popisu

Alert.test.js 891B

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * Copyright (c) Microsoft Corporation. All rights reserved.
  3. * Licensed under the MIT License.
  4. */
  5. import { driver, By2 } from 'selenium-appium'
  6. import { until } from 'selenium-webdriver';
  7. const setup = require('../jest-setups/jest.setup');
  8. jest.setTimeout(50000);
  9. beforeAll(() => {
  10. return driver.startWithCapabilities(setup.capabilites);
  11. });
  12. afterAll(() => {
  13. return driver.quit();
  14. });
  15. describe('Alert Tests', () => {
  16. test('Show Alert', async () => {
  17. const showAlertButton = await driver.wait(until.elementLocated(By2.nativeName('Show alert')));
  18. await showAlertButton.click();
  19. await driver.wait(until.elementLocated(By2.nativeName('Hello! I am an alert box!')));
  20. await By2.nativeName('OK').click();
  21. const dismissMessage = await driver.wait(until.elementLocated(By2.nativeName('Alert dismissed!')));
  22. expect(dismissMessage).not.toBeNull();
  23. });
  24. });