gianlucamangiapelo / wdio-azure-devops-service

Custom WDIO service to publish WebdriverIO results on Azure DevOps Test Plans.
MIT License
8 stars 5 forks source link

Service is not initialized (Mocha or Cucumber + JS (Node 16.17.0) + WDIO) #6

Open HannaTarasevich opened 1 year ago

HannaTarasevich commented 1 year ago

Hi! I dealt with the issue that service is not initialized (Mocha or Cucumber + JS (Node 16.17.0) + WDIO). Analyzed both issues (#1 and #4 ), checked the logs and there are no any data about the service. I use WDIO example files as a basis for verification and Azure trial subscription, I got appropriate responses using data from Azure API. My config looks like:

services: ['chromedriver','geckodriver',
  [AzureDevopsService,
  {
      pat: 'pat',
      organizationUrl: 'https://dev.azure.com/org',
      projectId: '8b3c68ac-f69d-41c6-bbad-921d8bae9819',
      planId: 6,
      suiteId: 8,
      caseIdRegex: '@?[ref](https://github.com/gianlucamangiapelo/wdio-azure-devops-service/blob/master/\\d+)',
      runName: 'FE regression tests for TestPlan',
  },

I tried to delete and change this key caseIdRegex, and there was no success.

2022-09-14T18:24:31.827Z INFO @wdio/local-runner: Run worker command: run 2022-09-14T18:24:31.829Z DEBUG @wdio/config:ConfigParser: No compiler found, continue without compiling files 2022-09-14T18:24:31.976Z DEBUG @wdio/local-runner:utils: init remote session 2022-09-14T18:24:31.979Z DEBUG @wdio/utils:initialiseServices: initialise service "chromedriver" as NPM package 2022-09-14T18:24:32.030Z DEBUG @wdio/utils:initialiseServices: initialise service "geckodriver" as NPM package 2022-09-14T18:24:32.071Z DEBUG @wdio/utils:initialiseServices: initialise custom initiated service 2022-09-14T18:24:32.086Z INFO geckodriver: Start Geckodriver (C:\azure-pipelines\node_modules\geckodriver\geckodriver.exe) with args: --log=trace --port=59070

image

Example of scenario:

Feature: The Internet Guinea Pig Website

@C5 Scenario Outline: As a user, I can log into the secure area

Tokens were generated with Full access and with Test Plan management, no changes

gianlucamangiapelo commented 1 year ago

Ciao @HannaTarasevich thanks for reaching me! I'm investigating to replicate the environment that you suggested.

In the meanwhile, have you tried just with Scenario Outline or also with Scenario?

HannaTarasevich commented 1 year ago

Hi @gianlucamangiapelo, I tried with scenarios as well as scenario outlines. I'm still experiencing the issue. Please let me know if I can help you with additional info. Thanks

gianlucamangiapelo commented 1 year ago

Hi, @HannaTarasevich did you find a solution to resolve the issue?

alex255 commented 1 year ago

Hello, any update ? I have the same problem

rakeshbs890 commented 1 year ago

Hi @gianlucamangiapelo,

I am also facing similar kind of issue, i can see from logs that service is able to connect to Azure DevOps test plan. But on execution completion, getLastTestRunId() call is failling to get test runs (getTestRuns(azureConfig.projectId, undefined, undefined, undefined, azureConfig.planId, undefined, undefined, undefined);) Throwing un-know error as test run are not returned. function getLastTestRunId(azureClient, azureConfig) { return __awaiter(this, void 0, void 0, function* () { const testRun = yield azureClient.getTestRuns(azureConfig.projectId, undefined, undefined, undefined, azureConfig.planId, undefined, undefined, undefined); if (!testRun || !testRun.length) { throw new Error(); } testRun.sort((a, b) => a.id - b.id); return testRun[testRun.length - 1].id; }); } exports.getLastTestRunId = getLastTestRunId;

Please help with solution

Thanks in advance

paurushtaunk commented 1 year ago

Hi @gianlucamangiapelo , When i use this Service and try to run the WDIO test, In Azure Test Plans the test case is getting marked as "Not Applicable" instead of fail or pass

sundarlogan commented 5 months ago

Hi @paurushtaunk @gianlucamangiapelo

I am also, facing same issue - In Azure Test Plans the test case is getting marked as "Not Applicable" instead of fail or pass. Any updates that worked? Pls. let me know.