Z
Z
zombieman2021-11-22 19:15:59
PowerShell
zombieman, 2021-11-22 19:15:59

How to run c# Selenium tests via GitLab Runner?

that's the problem, there is a simple Selenium test (Sharp) on the test machine, there is just a Powershell script on the same machine that will run the test

Start-Process -FilePath "C:\Users\Username\Desktop\publish\PowerTests.exe" -wait -verb runas


there is GilLab CI (and GitLab Runner is ready inside it with this config.toml

  name = "MyTestRunner"
  url = "https://gitlab.ru/"
  token = "Token"
  executor = "shell"
  shell = "powershell"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
  [runners.custom]
    run_exec = ""


here is another .gitlab-ci.yml (there are several calls to the PS script, one on the test computer, the second in the GitLab repository)
demo_test:
  image: 
    name: "mcr.microsoft.com/powershell:latest"
  tags: 
    - myName
  script:
    - powershell -Command "Get-Date"  
    - powershell -File C:\Users\Username\Desktop\start.ps1
    - powershell ./start.ps1


So, the essence of the problem
seems to be everything is working correctly
Job works out, and writes that the tests are running and in general everything is fine
Running with gitlab-runner 12.1.0 (-----)
  on myName
Using Shell executor...
00:00
Running on MachineName...
00:01
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in C:/Work/GitLab-Runner/builds/2UPXqpDu/0/Username/tests/.git/
Checking out ------as master...
git-lfs/2.11.0 (GitHub; windows amd64; go 1.14.2; git 48b28d97)
Skipping Git submodules setup
$ powershell ./start.ps1
$ powershell -Command "Get-Date"
22 ������ 2021 �. 18:56:21
$ powershell -File C:\Users\Username\Desktop\start.ps1
22 ������ 2021 �. 18:56:21
$ Start-Process -File C:\Users\Username\Desktop\start.ps1
$ "C:\Users\Username\Desktop\start.ps1"
C:\Users\Username\Desktop\start.ps1
Job succeeded


But nothing is displayed on the test machine, a process with the name of the tests appears and after a while it is cut off.
619bbdb6a283d572725581.png

and how is it correct to use a powerShell script from GitLab Runner so that Selenium tests can be seen visually and not only in the process?

PS I will be very grateful for any help, the second day I can not solve the problem

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question