当我尝试运行样本测试时,它将无法进行测试。
Execution of 1 workers started at 2022-02-05T16:37:33.955Z
2022-02-05T16:37:33.963Z DEBUG @wdio/utils:initialiseServices: initialise service "appium" as NPM package
2022-02-05T16:37:34.152Z INFO @wdio/cli:launcher: Run onPrepare hook
2022-02-05T16:37:34.155Z DEBUG @wdio/appium-service: Will spawn Appium process: appium --base-path / --session-override --debug-log-spacing --no-reset --automation-name XCUITest --platform-name iOS --platform-version 15.2 --device-name 'iPhone 13 Simulator' --udid E948D1B3-15E8-4782-824F-0A3BBAA45C7E --app com.apple.Preferences
2022-02-05T16:37:38.491Z DEBUG @wdio/appium-service: Appium started with ID: 83676
2022-02-05T16:37:38.492Z DEBUG @wdio/cli:utils: Finished to run "onPrepare" hook in 4339ms
2022-02-05T16:37:38.495Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2022-02-05T16:37:38.495Z DEBUG @wdio/cli:utils: Finished to run "onWorkerStart" hook in 0ms
2022-02-05T16:37:38.498Z INFO @wdio/local-runner: Start worker 0-0 with arg: run,./config/wdio.conf.ts
[0-0] 2022-02-05T16:37:41.532Z INFO @wdio/local-runner: Run worker command: run
[0-0] 2022-02-05T16:37:43.058Z DEBUG @wdio/config:utils: Found 'ts-node' package, auto-compiling TypeScript files
[0-0] 2022-02-05T16:37:43.624Z DEBUG @wdio/local-runner:utils: init remote session
[0-0] 2022-02-05T16:37:43.654Z DEBUG @wdio/utils:initialiseServices: initialise service "appium" as NPM package
[0-0] RUNNING in undefined - /src/featureFiles/sampleTest.feature
[0-0] 2022-02-05T16:37:46.089Z DEBUG @wdio/local-runner:utils: init remote session
[0-0] 2022-02-05T16:37:46.092Z INFO webdriver: Initiate new session using the WebDriver protocol
[0-0] 2022-02-05T16:37:46.505Z INFO webdriver: [POST] http://localhost:4723/session
[0-0] 2022-02-05T16:37:46.506Z INFO webdriver: DATA {
[0-0] capabilities: { alwaysMatch: {}, firstMatch: [ {} ] },
[0-0] desiredCapabilities: {}
[0-0] }
[0-0] 2022-02-05T16:39:46.878Z WARN webdriver: Request timed out! Consider increasing the "connectionRetryTimeout" option.
[0-0] 2022-02-05T16:39:46.883Z INFO webdriver: Retrying 1/3
[0-0] 2022-02-05T16:39:46.902Z INFO webdriver: [POST] http://localhost:4723/session
[0-0] 2022-02-05T16:39:46.920Z INFO webdriver: DATA {
[0-0] capabilities: { alwaysMatch: {}, firstMatch: [ {} ] },
[0-0] desiredCapabilities: {}
[0-0] }
[0-0] 2022-02-05T16:41:47.015Z WARN webdriver: Request timed out! Consider increasing the "connectionRetryTimeout" option.
[0-0] 2022-02-05T16:41:47.023Z INFO webdriver: Retrying 2/3
[0-0] 2022-02-05T16:41:47.023Z INFO webdriver: [POST] http://localhost:4723/session
[0-0] 2022-02-05T16:41:47.024Z INFO webdriver: DATA {
[0-0] capabilities: { alwaysMatch: {}, firstMatch: [ {} ] },
[0-0] desiredCapabilities: {}
[0-0] }
[0-0] 2022-02-05T16:43:47.081Z WARN webdriver: Request timed out! Consider increasing the "connectionRetryTimeout" option.
[0-0] 2022-02-05T16:43:47.086Z INFO webdriver: Retrying 3/3
[0-0] 2022-02-05T16:43:47.086Z INFO webdriver: [POST] http://localhost:4723/session
[0-0] 2022-02-05T16:43:47.086Z INFO webdriver: DATA {
[0-0] capabilities: { alwaysMatch: {}, firstMatch: [ {} ] },
[0-0] desiredCapabilities: {}
[0-0] }
[0-0] 2022-02-05T16:45:47.144Z ERROR webdriver: Request failed with status undefined due to TimeoutError: Timeout awaiting 'request' for 120000ms when running "http://localhost:4723/session" with method "POST" and args "{"capabilities":{"alwaysMatch":{},"firstMatch":[{}]},"desiredCapabilities":{}}"
[0-0] 2022-02-05T16:45:47.152Z ERROR webdriver: TimeoutError: Timeout awaiting 'request' for 120000ms when running "http://localhost:4723/session" with method "POST" and args "{"capabilities":{"alwaysMatch":{},"firstMatch":[{}]},"desiredCapabilities":{}}"
[0-0] at getTimeoutError (/Users/jacquelinegeorge/Documents/WebdriverIO-V6-appium-cucumber-boilerplate-master/node_modules/@wdio/runner/node_modules/webdriver/build/utils.js:322:24)
[0-0] at NodeJSRequest._request (/Users/jacquelinegeorge/Documents/WebdriverIO-V6-appium-cucumber-boilerplate-master/node_modules/@wdio/runner/node_modules/webdriver/build/request/index.js:147:59)
[0-0] at processTicksAndRejections (node:internal/process/task_queues:96:5)
[0-0] at async startWebDriverSession (/Users/jacquelinegeorge/Documents/WebdriverIO-V6-appium-cucumber-boilerplate-master/node_modules/@wdio/runner/node_modules/webdriver/build/utils.js:67:20)
[0-0] at async Function.newSession (/Users/jacquelinegeorge/Documents/WebdriverIO-V6-appium-cucumber-boilerplate-master/node_modules/@wdio/runner/node_modules/webdriver/build/index.js:42:45)
[0-0] at async remote (/Users/jacquelinegeorge/Documents/WebdriverIO-V6-appium-cucumber-boilerplate-master/node_modules/@wdio/runner/node_modules/webdriverio/build/index.js:73:22)
[0-0] at async Runner._startSession (/Users/jacquelinegeorge/Documents/WebdriverIO-V6-appium-cucumber-boilerplate-master/node_modules/@wdio/runner/build/index.js:223:56)
[0-0] at async Runner._initSession (/Users/jacquelinegeorge/Documents/WebdriverIO-V6-appium-cucumber-boilerplate-master/node_modules/@wdio/runner/build/index.js:176:25)
[0-0] at async Runner.run (/Users/jacquelinegeorge/Documents/WebdriverIO-V6-appium-cucumber-boilerplate-master/node_modules/@wdio/runner/build/index.js:88:19)
[0-0] 2022-02-05T16:45:47.475Z ERROR @wdio/runner: Error: Failed to create session.
[0-0] Timeout awaiting 'request' for 120000ms when running "http://localhost:4723/session" with method "POST" and args "{"capabilities":{"alwaysMatch":{},"firstMatch":[{}]},"desiredCapabilities":{}}"
[0-0] at startWebDriverSession (/Users/jacquelinegeorge/Documents/WebdriverIO-V6-appium-cucumber-boilerplate-master/node_modules/@wdio/runner/node_modules/webdriver/build/utils.js:72:15)
[0-0] at processTicksAndRejections (node:internal/process/task_queues:96:5)
[0-0] at async Function.newSession (/Users/jacquelinegeorge/Documents/WebdriverIO-V6-appium-cucumber-boilerplate-master/node_modules/@wdio/runner/node_modules/webdriver/build/index.js:42:45)
[0-0] at async remote (/Users/jacquelinegeorge/Documents/WebdriverIO-V6-appium-cucumber-boilerplate-master/node_modules/@wdio/runner/node_modules/webdriverio/build/index.js:73:22)
[0-0] at async Runner._startSession (/Users/jacquelinegeorge/Documents/WebdriverIO-V6-appium-cucumber-boilerplate-master/node_modules/@wdio/runner/build/index.js:223:56)
[0-0] at async Runner._initSession (/Users/jacquelinegeorge/Documents/WebdriverIO-V6-appium-cucumber-boilerplate-master/node_modules/@wdio/runner/build/index.js:176:25)
[0-0] at async Runner.run (/Users/jacquelinegeorge/Documents/WebdriverIO-V6-appium-cucumber-boilerplate-master/node_modules/@wdio/runner/build/index.js:88:19)
2022-02-05T16:45:47.748Z DEBUG @wdio/local-runner: Runner 0-0 finished with exit code 1
[0-0] FAILED in undefined - /src/featureFiles/sampleTest.feature
2022-02-05T16:45:47.761Z INFO @wdio/cli:launcher: Run onComplete hook
2022-02-05T16:45:47.764Z DEBUG @wdio/appium-service: Appium (pid: 83676) killed
2022-02-05T16:45:47.765Z DEBUG @wdio/cli:utils: Finished to run "onComplete" hook in 3ms
Spec Files: 0 passed, 1 failed, 1 total (100% completed) in 00:08:13
2022-02-05T16:45:47.770Z INFO @wdio/local-runner: Shutting down spawned worker
2022-02-05T16:45:48.027Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2022-02-05T16:45:48.031Z INFO @wdio/local-runner: shutting down
{
“compilerOptions”: {
“outDir”: “./.tsbuild/”,
“sourceMap”: false,
“target”: “es2019”,
“module”: “commonjs”,
“removeComments”: true,
“noImplicitAny”: true,
“strictPropertyInitialization”: true,
“strictNullChecks”: true,
“types”: [
“node”,
“webdriverio/async”,
“@wdio/mocha-framework”,
“@wdio/sauce-service”,
“@wdio/appium-service” ]
},
“include”: [
“./src/**/*.ts”
]
}
import { join } from 'path';
export const config : WebdriverIO.Config = {
//
// ====================
// Runner Configuration
// ====================
//
// WebdriverIO allows it to run your tests in arbitrary locations (e.g. locally or
// on a remote machine).
runner: 'local',
//sync: true,
//
// ==================
// Specify Test Files
// ==================
// Define which test specs should run. The pattern is relative to the directory
// from which `wdio` was called. Notice that, if you are calling `wdio` from an
// NPM script (see https://docs.npmjs.com/cli/run-script) then the current working
// directory is where your package.json resides, so `wdio` will be called from there.
//
specs: [
'./src/featureFiles/sampleTest.feature'
],
// Patterns to exclude.
exclude: [
// 'path/to/excluded/files'
],
//
// ============
// Capabilities
// ============
// Define your capabilities here. WebdriverIO can run multiple capabilities at the same
// time. Depending on the number of capabilities, WebdriverIO launches several test
// sessions. Within your capabilities you can overwrite the spec and exclude options in
// order to group specific specs to a specific capability.
//
// First, you can define how many instances should be started at the same time. Let's
// say you have 3 different capabilities (Chrome, Firefox, and Safari) and you have
// set maxInstances to 1; wdio will spawn 3 processes. Therefore, if you have 10 spec
// files and you set maxInstances to 10, all spec files will get tested at the same time
// and 30 processes will get spawned. The property handles how many capabilities
// from the same test should run tests.
//
//
// If you have trouble getting all important capabilities together, check out the
// Sauce Labs platform configurator - a great tool to configure your capabilities:
// https://docs.saucelabs.com/reference/platforms-configurator
//
capabilities: [{
// capabilities are added in the individual config files for browser and native apps
}],
//
// ===================
// Test Configurations
// ===================
// Define all options that are relevant for the WebdriverIO instance here
//
// Level of logging verbosity: trace | debug | info | warn | error | silent
logLevel: 'debug',
//
// Set specific log levels per logger
// loggers:
// - webdriver, webdriverio
// - @wdio/applitools-service, @wdio/browserstack-service, @wdio/devtools-service, @wdio/sauce-service
// - @wdio/mocha-framework, @wdio/jasmine-framework
// - @wdio/local-runner, @wdio/lambda-runner
// - @wdio/sumologic-reporter
// - @wdio/cli, @wdio/config, @wdio/sync, @wdio/utils
// Level of logging verbosity: trace | debug | info | warn | error | silent
logLevels: {
webdriver: 'debug',
'@wdio/applitools-service': 'debug'
},
//
// If you only want to run your tests until a specific amount of tests have failed use
// bail (default is 0 - don't bail, run all tests).
bail: 0,
// Default timeout for all waitFor* commands.
waitforTimeout: 10000,
//
// Default timeout in milliseconds for request
// if browser driver or grid doesn't send response
connectionRetryTimeout: 120000,
//
// Default request retries count
connectionRetryCount: 3,
//
// Test runner services
// Services take over a specific job you don't want to take care of. They enhance
// your test setup with almost no effort. Unlike plugins, they don't add new
// commands. Instead, they hook themselves up into the test process.
services: [
// "chromedriver",
// "sauce",
[
"appium",
{
command: "appium",
args: {
sessionOverride: true,
debugLogSpacing: true,
noReset: true,
fullReset: false,
automationName: "XCUITest",
platformName: "iOS",
platformVersion: "15.2",
deviceName: "iPhone 13 Simulator",
udid: "E948D1B3-15E8-4782-824F-0A3BBAA45C7E",
app: "com.apple.Preferences",
},
},
],
],
port: 4723,
path: '/wd/hub',
// Framework you want to run your specs with.
// The following are supported: Mocha, Jasmine, and Cucumber
// see also: https://webdriver.io/docs/frameworks.html
//
// Make sure you have the wdio adapter package for the specific framework installed
// before running any tests.
framework: 'cucumber',
cucumberOpts: {
backtrace: false,
requireModule: [],
failAmbiguousDefinitions: false,
failFast: false,
ignoreUndefinedDefinitions: false,
name: [],
profile: [],
require: [
'./src/stepDefinitions/steps.ts'
],
snippetSyntax: undefined,
snippets: true,
source: true,
strict: false,
tagsInTitle: false,
timeout: 50000,
retry: 0
},
//
// The number of times to retry the entire specfile when it fails as a whole
// specFileRetries: 1,
//
// Whether or not retried specfiles should be retried immediately or deferred to the end of the queue
// specFileRetriesDeferred: false,
//
// Test reporter for stdout.
// The only one supported by default is 'dot'
// see also: https://webdriver.io/docs/dot-reporter.html
reporters: ["spec", ["allure", { outputDir: "allure-results" }]],
您已经找到了解决方案了吗?