Integrate CodeceptJS with Azure DevOps - azure

I want to update the test results of my CodeceptJS scripts in Azure DevOps. I have each test script created for corresponding test case in DevOps. Now I wan the test results to be updated directly in Azure whenever I run the script.
Can someone please suggest me how to link CodeceptJS with Azure DevOps? Is there any API or Plugin available?

I am afraid there is not a plugin available to associate js test scripts to test cases in DevOps.
Currently only Tests that use MSTest v2, NUnit, and xUnit frameworks can be associated with a test case workitem when using Visual Studio 15.9 Preview 2 or later. See document What types of tests are supported.
However, you can use rest api to update the test case results in azure devops.
First, create test plans to include the test cases work item
Second, call Point list rest api to list all the test points associated to your test cases
Then call point update rest api to update the test result.

Related

Hi is there a way to run pytest-bdd scenarios from Azure test plan or connect azure pipeline (pytest) to run from test plan scenarios

I have to map Automation test scenarios created with pytest-bdd to Azure test plan and be able to execute directly from test plan to update run results on test case. After reading Azure documentation it was mentioned that pytest framework is not supported, is there a work around to run pytest-bdd from test plan to populate results? I already created azure pipeline and using that to run tests, but not sure how to populate results to test-plan
Tried to associate pipeline directly to test scenario, there is no way to do it.

anywork around for running Azure devops Test plans for javascript tests?

Currently Azure devops maynot work with javascript tests.
Has anyone found work around for running Jest/Mocha/ codeceptjs/ webdriver io tests as part of Test plans?
Here is a blog introducing Integrate test automation framework with Azure Test Plan. In order to achieve this we will make use of the Azure DevOps APIs.
I was able to successfully integrate this set up with Java-Cucumber
tests and Robot-Python tests. Likewise this can be extended to any JS
framework like WebDriverIO or Cypress.

How to create test case in azure devops using rest api in python

Can anyone please share the details how to create a test case in azure devops using rest api, preferably in python code. I couldn't find a direct API in azure devops but they shared an API for work item. But I don't have an idea how the body should be while creating a test case. Please suggest.
https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work%20items/create?view=azure-devops-rest-6.1
How to create test case in azure devops using rest api in python
The test case is also a work item. That is the reason why they shared an API for work item for you.
When you create a workitem with TestCase type:
Then we could find it display on the test case tab:
So, we could use the REST API Create a work item to create a workitem with Testcase type to create the test case:
PATCH https://{instance}/DefaultCollection/{project}/_apis/wit/workitems/${workItemTypeName}?api-version={version}
On the other hand, we could check the REST API about the Test cases, there are Get a test case, Delete a test case but no create the test case API directly.
To create a workitem in python, you could refer this official Azure DevOps Python API doc.
It contains Python APIs for interacting with and managing Azure
DevOps. These APIs power the Azure DevOps Extension for Azure CLI. To
learn more about the Azure DevOps Extension for Azure CLI, visit the
Microsoft/azure-devops-cli-extension repo.
Here is some example code for creating work item in python.
You could check this thread for some more details.

Machine learning in Azure: How do I publish a pipeline to the workspace once I've already built it in Python using the SDK?

I don't know where else to ask this question so would appreciate any help or feedback. I've been reading the SDK documentation for azure machine learning service (in particular azureml.core). There's a class called Pipeline that has methdods validate() and publish(). Here are the docs for this:
https://learn.microsoft.com/en-us/python/api/azureml-pipeline-core/azureml.pipeline.core.pipeline.pipeline?view=azure-ml-py
When I call validate(), everything validates and I call publish but it seems to only create an API endpoint in the workspace, it doesn't register my pipeline under Pipelines and there's obviously nothing in the designer.
My question: I want to publish my pipeline so I just have to launch from the workspace with one click. I've built it already using the SDK (Python code). I don't want to work with an API. Is there any way to do this or would I have to rebuild the entire pipeline using the designer (drag and drop)?
Totally empathize with your confusion. Our team has been working with Azure ML pipelines for quite some time but PublishedPipelines still confused me initially because:
what the SDK calls a PublishedPipeline is called as a Pipeline Endpoint in the Studio UI, and
it is semi-related to Dataset and Model's .register() method, but fundamentally different.
TL;DR: all Pipeline.publish() does is create an endpoint that you can use to:
schedule and version Pipelines, and
re-run the pipeline from other services via a REST API call (e.g. via Azure Data Factory).
You can see PublishedPipelines in the Studio UI in two places:
Pipelines page :: Pipeline Endpoints tab
Endpoints page :: Pipeline Endpoints tab

Generic selenium testing in Azure DevOps pipelines

I am currently working on generic selenium tests to add to all my pipelines.
Because all my projects are similar (webshops) but have different solutions, I created a independent project to execute unit tests for all these webshops. I am wondering if it is possible to execute these tests in the independent project the Azure DevOps pipeline.
What are my possibilities?
Thank you,
Thomas

Resources