Currently, I am running my Playwright tests with a JavaScript framework in a Bitbucket pipeline for CI/CD. However, the issue is that my XML file is not being generated in the source directory within the root folder after committing the code to Bitbucket. The pipeline is picking up the results.xml
file from the existing source directory instead of the newly generated file. Although the results.xml
is stored as an artifact, the pipeline continues to use the outdated version from the root directory.
this is my yml script for the pipeline
Hello @ragsagarm and welcome to the Community!
Artifact in bitbucket are used to share files between different steps. In the example that you shared, you have a single step only, so artifacts are not really being used (the after-script section is considered part of the same step, it does not run in a separate container).
Having said that, my understanding is that your repository contains a file named results.xml, but during the pipelines, you create an updated version or this file, and want to use this updated version in the rest of the commands.
It would be important to validate if the results.xml file is actually being updated by the commands you're executing, so I would suggest printing the output of that file in different sections of your build :
script:
- cat results.xml #1 print the original file present in the repo
- npm ci
- npx playwright test --reporter=html,junit
- cat test-results/junit.xml #2 print the file generated by playwright
- mv test-results/junit.xml results.xml
- cat results.xml #3 print the file to check if the file content was updated with the content generated by previous commands
after-script:
- |
cat results.xml # print the file to see if the content matches with #3
echo "Checking for test results file..."
This would help to identify at which point of your build the file is not getting updated, so you can make the necessary changes.
Thank you, @ragsagarm !
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.