How to run selenide tests in bitbucket-pipelines (selenoid)
Asked by Vitali Konachyk:

It is necessary to run tests on selenide in selenoid on bitbucket-pipelines, I did everything locally, and it works, but now it is unclear how to implement it in bitbucket. I have no experience writing bitbucket-pipelines.yml  

Locally I :  
1. Installed docker  
2.Launched docker  
3. Downloaded the start file (<https://github.com/aerokube/cm/releases/tag/1.8.1> ) 4.Launched it with the command '$ ./cm selenoid start --vnc' and '$ ./cm selenoid-launching the user  
interface'  
5. Launched the tests with the command 'mvn test'


Answers:
author: Norbert C
body: Hi [@Vitali Konachyk](/t5/user/viewprofilepage/user-id/4824531)

Thank you for contacting Atlassian Community, my name is Norbert and I'm a Bitbucket Cloud Support Engineer, it's nice to meet with you! Welcome to the Atlassian Community!

I would like to inform you that Bitbucket Pipelines is a service, which basically runs a Docker image and within the Docker image, it runs commands.

For the basics, how you can get started with Bitbucket Pipelines, I would like to suggest you to read through these set of documentation: <https://support.atlassian.com/bitbucket-cloud/docs/get-started-with-bitbucket-pipelines/>

Let me give you a template:  

```
image: docker_image_that_you_used_locally

pipelines:

default:
 - step:
     services: 
      - docker

script:
 - wget https://github.com/aerokube/cm/releases/tag/1.8.1
 - ./cm selenoid start --vnc
- ./cm selenoid-launching 
- mvn test

definitions: 
services: 
docker: 
memory: 512
```

Please let me know how it goes, we're here to help.

Best Regards,  
Norbert  
Atlassian Bitbucket Cloud Support

comments: author: Vitali Konachyk
body: Hi!   
I supplemented the script, but it didn't help. Not enough accesses(![image (2).png](https://community.atlassian.com/t5/image/serverpage/image-id/189187i281CEE2540541E70/image-size/large?v=v2&px=999 "image (2).png")![image (3).png](https://community.atlassian.com/t5/image/serverpage/image-id/189188iDA49E044D37F52F0/image-size/large?v=v2&px=999 "image (3).png")


author: Norbert C
body: Hi [@Vitali Konachyk](/t5/user/viewprofilepage/user-id/4824531)

Thank you for the picture, there was no Docker service initiated, that's why you had this problem.  

I edited yesterday's comment with a docker service.

Can you try that and let me know if it works for you?

Best Regards,  
Norbert  
Atlassian Bitbucket Cloud Support


author: Vitali Konachyk
body: Hi! I have updated the dock, but a new problem has appeared  

<br />

![?????? ?????? 2022-03-22 104103.png](https://community.atlassian.com/t5/image/serverpage/image-id/189288iCCBC96A0A2242441/image-size/large?v=v2&px=999 "?????? ?????? 2022-03-22 104103.png")![?????? ?????? 2022-03-22 104124.png](https://community.atlassian.com/t5/image/serverpage/image-id/189289i9AD1EFF1DA0D6DEE/image-size/large?v=v2&px=999 "?????? ?????? 2022-03-22 104124.png")  

<br />

<br />

<br />

<br />


author: Vitali Konachyk
body: "x Failed to start: failed to create container: Error response from daemon: authorization denied by plugin pipelines: -v only supports $BITBUCKET_CLONE_DIR and its subdirectories"


author: Vitali Konachyk
body: [@Norbert C](/t5/user/viewprofilepage/user-id/1190200)


author: Theodora Boudale
body: Hi [@Vitali Konachyk](/t5/user/viewprofilepage/user-id/4824531),

Please allow me to step in as Norbert is out of office.

Based on the error message, it looks that the command you are running may be trying to create a Docker container and mount volumes outside $BITBUCKET_CLONE_DIR ($BITBUCKET_CLONE_DIR is the path where your repo is cloned in the Docker container that runs your build).

If so, this is something that is not supported in Pipelines, see below the section "Full list of restricted commands":

* <https://support.atlassian.com/bitbucket-cloud/docs/run-docker-commands-in-bitbucket-pipelines/>

I would suggest reaching out to the developers of selenoid (you can create an issue here: <https://github.com/aerokube/selenoid/issues>), ask what directory is being mounted, and if it is possible to change that e.g. with a configuration file in your repo.

Kind regards,  
Theodora


Tags: bitbucket-cloud

maven

selenoid