{"id":22713181,"url":"https://github.com/ddavison/gitlab-browserstack-example","last_synced_at":"2025-09-21T21:50:31.212Z","repository":{"id":69010091,"uuid":"211216306","full_name":"ddavison/gitlab-browserstack-example","owner":"ddavison","description":"A sample configuration showing how you can run your automated tests against BrowserStack using GitLab CI","archived":false,"fork":false,"pushed_at":"2019-09-27T02:04:05.000Z","size":2,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T22:43:22.747Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://gitlab.com/ddavison/gitlab-browserstack-example/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ddavison.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-27T02:03:57.000Z","updated_at":"2020-12-22T16:42:49.000Z","dependencies_parsed_at":"2023-09-14T19:02:35.604Z","dependency_job_id":null,"html_url":"https://github.com/ddavison/gitlab-browserstack-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ddavison/gitlab-browserstack-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddavison%2Fgitlab-browserstack-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddavison%2Fgitlab-browserstack-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddavison%2Fgitlab-browserstack-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddavison%2Fgitlab-browserstack-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ddavison","download_url":"https://codeload.github.com/ddavison/gitlab-browserstack-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddavison%2Fgitlab-browserstack-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276312967,"owners_count":25620626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-21T02:00:07.055Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-10T14:08:31.865Z","updated_at":"2025-09-21T21:50:31.183Z","avatar_url":"https://github.com/ddavison.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Running Selenium Tests against BrowserStack using GitLab CI\n\n\u003e This project serves as a minimal example of how to run UI tests against BrowserStack\n\u003e through GitLab CI using the Selenium Ruby bindings.\n\nThere are essentially two pieces required to get GitLab CI working with BrowserStack.\n\n  1. A `.gitlab-ci.yml` file\n  1. BrowserStack Username / Access Key\n  \n## How it works\n\n### [`spec/browserstack_spec.rb`]\nIn this example, [`spec/browserstack_spec.rb`] \nis the main piece and is an RSpec test file.\n\nThis file contains one essential piece to getting BrowserStack configured:\n\n```ruby\nlet(:capabilities) do\n  {\n    browser: :chrome,\n    browser_version: '77.0',\n   os: 'OS X',\n   os_version: 'Mojave',\n   project: 'gitlab-browserstack-example',\n   build: ENV['CI_JOB_ID']\n }\nend\n```\n\nHere we are configuring the [Desired Capabilities](https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities)\nfor Selenium as well as BrowserStack.\n\nYou'll notice we are also specifying `ENV['CI_JOB_ID']`. This is a \n[pre-defined GitLab CI environment variable](https://docs.gitlab.com/ee/ci/variables/predefined_variables.html) and it\nis to differentiate each run by associating it with a GitLab Job.\n\nUnder the `capabilities` hash, we specify\n[everything we'd like to configure BrowserStack](https://www.browserstack.com/automate/ruby) with.\n\n- Username\n- Access Key\n- Tags / Name / Build for naming your build in BrowserStack\n\n### [`.gitlab-ci.yml`]\n\nOur [GitLab CI](https://docs.gitlab.com/ee/ci/README.html) configuration file contains one stage called `test`, that \nruns when we run the job manually.\n\n\u003e In an actual CI/CD environment, you'd most likely have `when:manual` removed, meaning that these\n\u003e tests will run against BrowserStack on every push / merge request to `master`.\n\u003e\n\n[`spec/browserstack_spec.rb`]: https://gitlab.com/ddavison/gitlab-browserstack-example/tree/master/spec/browserstack_spec.rb\n[`.gitlab-ci.yml`]: https://gitlab.com/ddavison/gitlab-browserstack-example/tree/master/.gitlab-ci.yml\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddavison%2Fgitlab-browserstack-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fddavison%2Fgitlab-browserstack-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddavison%2Fgitlab-browserstack-example/lists"}