Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot run Playwright Typescript on Bitbucket Pipeline.

SSE
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 18, 2024

Hello.

 

I have the following files:

bitbucket-pipelines.yml

 

Ubuntu Pastebin

 

package.json

 

Ubuntu Pastebin

 

 

package.lock.json

 

Ubuntu Pastebin

 

When I try to run the pipeline, I get this error:

 

Ubuntu Pastebin

 

Please suggest how to resolve this.

I tried several different images, but its not working.

 

Thank you for your time.

2 answers

1 vote
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 20, 2024

Hi @SSE and welcome to the community!

I would actually recommend combining the two steps into one, instead of keeping two separate steps and referencing the cache in both steps.

Caches are temporary, so your builds should be configured to work whether or not the cache is present. Any cache which is older than 1 week will be cleared automatically and repopulated during the next build. Additionally, users can manually remove a cache from the Pipelines page of a repo. So, if a cache expires or if it is manually removed by someone right before the second step runs, then your build will fail.

You can combine both steps into one as follows:

image: mcr.microsoft.com/playwright:v1.49.0-noble

pipelines:
default:
- step:
name: Install dependencies and Run Playwright tests
caches:
- node
script:
- npm ci
- npx playwright install-deps
- npx playwright install
- npx playwright test

Kind regards,
Theodora

0 votes
Saxea _Flowie_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 18, 2024

Hi @SSE

Each step is runs on a separated docker container. You can solve this by installing deps and running within the same step, or referencing the cache on every step you want to use it. You reference it in same way you did in the first step.

 

SSE
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 19, 2024

Hello.
Thank you for your response. 
Can you please show me an example or help guide me to update mine?

Saxea _Flowie_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 19, 2024

Sure:

image: mcr.microsoft.com/playwright:v1.49.0-noble

pipelines:
  default:
    - step:
        name: Install dependencies
        caches:
          - node
        script:
          - npm ci
          - npx playwright install-deps
          - npx playwright install
    - step:
        name: Run Playwright tests
#### Reference the cache here
caches:
- node
script: - npx playwright test

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events