Skip to content

Commit 8c9ad91

Browse files
Merge pull request #2 from BrowserStackCE/develop
Develop
2 parents 2194a42 + 21f4f1f commit 8c9ad91

File tree

19 files changed

+612
-1
lines changed

19 files changed

+612
-1
lines changed

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.idea/
2+
target/
3+
.DS_Store
4+
logs/
5+
local.log
6+
*.iml
7+
node_modules/
8+
results/
9+
log/
10+
package-lock.json
11+
*.log

.gitkeep

Whitespace-only changes.

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1-
# browserstack-automate-debugging-tasks
1+
# Debugging assignments for Automate
2+
3+
Clone the repository to resolve the following.
4+
5+
## Selenium
6+
* Resolve privacy related errors in the code
7+
* Resolve timeout issues
8+
* Configure the tests to run in parallel
9+
10+
## Cypress
11+
* Fix any compilation errors
12+
13+
14+
Detailed problem statement can be found on the confluence page.

cypress/.gitkeep

Whitespace-only changes.

cypress/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Instructions:
2+
3+
Download the repo and fix any compilation errors.
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# Kitchen Sink [![renovate-app badge][renovate-badge]][renovate-app] [![semantic-release][semantic-image] ][semantic-url]
2+
3+
This is an example app used to showcase [Cypress.io](https://www.cypress.io/) testing. The application uses every API command in Cypress for demonstration purposes. Additionally this example app is configured to run tests in various CI platforms. The [tests](https://github.com/cypress-io/cypress-example-kitchensink/tree/master/cypress/e2e) are also heavily commented. For a full reference of our documentation, go to [docs.cypress.io](https://docs.cypress.io/).
4+
5+
To see the kitchen sink application, visit [example.cypress.io](https://example.cypress.io/).
6+
7+
[renovate-badge]: https://img.shields.io/badge/renovate-app-blue.svg
8+
[renovate-app]: https://renovateapp.com/
9+
[semantic-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
10+
[semantic-url]: https://github.com/semantic-release/semantic-release
11+
12+
## CI Status
13+
14+
The following table lists live workflows from various CI providers. These each independently test the contents of this example repository. They run and record using [Cypress Cloud](https://on.cypress.io/guides/cloud/introduction) with their results displaying centrally under Cypress Cloud [ProjectId `4b7344`](https://cloud.cypress.io/#/projects/4b7344/runs). Each CI provider shows its build status on its own site:
15+
16+
CI Provider | Workflow | Build Status |
17+
:--- | :--- | :--- |
18+
[AppVeyor][AppVeyor docs] | [appveyor.yml][AppVeyor workflow] | [![AppVeyor CI][AppVeyor badge]][AppVeyor log] |
19+
[CircleCI][CircleCi docs] | [.circleci/config.yml][CircleCI workflow] | [![CircleCI][CircleCI badge]][CircleCI log] |
20+
[**cypress-io/github-action**][Cy GitHub Actions docs] | [using-action.yml][Cy GitHub Actions workflow] | [![Cypress GHA status][Cy GitHub Actions badge]][Cy GitHub Actions log]
21+
[GitHub Actions][GitHub Actions docs] | [parallel.yml][GitHub Actions workflow] | [![Parallel tests status][GitHub Actions badge]][GitHub Actions log]
22+
[Netlify][Netlify docs] | [netlify.toml][Netlify workflow] | [![Netlify Status][Netlify badge]][Netlify log]
23+
24+
<!-- CI provider links -->
25+
[AppVeyor docs]: https://www.appveyor.com/docs/
26+
[AppVeyor badge]: https://ci.appveyor.com/api/projects/status/bo4x59pha1eb18de/branch/master?svg=true
27+
[AppVeyor log]: https://ci.appveyor.com/project/cypress-io/cypress-example-kitchensink
28+
[AppVeyor workflow]: appveyor.yml
29+
30+
[CircleCI docs]: https://circleci.com/docs/
31+
[CircleCI badge]: https://circleci.com/gh/cypress-io/cypress-example-kitchensink/tree/master.svg?style=shield
32+
[CircleCI log]: https://circleci.com/gh/cypress-io/cypress-example-kitchensink/tree/master
33+
[CircleCI workflow]: .circleci/config.yml
34+
35+
[Cy GitHub Actions docs]: https://github.com/cypress-io/github-action#readme
36+
[Cy GitHub Actions badge]: https://github.com/cypress-io/cypress-example-kitchensink/actions/workflows/using-action.yml/badge.svg
37+
[Cy GitHub Actions log]: https://github.com/cypress-io/cypress-example-kitchensink/actions/workflows/using-action.yml?query=branch%3Amaster
38+
[Cy GitHub Actions workflow]: https://github.com/cypress-io/cypress-example-kitchensink/actions/workflows/using-action.yml
39+
40+
[GitHub Actions docs]: https://docs.github.com/en/actions
41+
[GitHub Actions badge]: https://github.com/cypress-io/cypress-example-kitchensink/actions/workflows/parallel.yml/badge.svg
42+
[GitHub Actions log]: https://github.com/cypress-io/cypress-example-kitchensink/actions/workflows/parallel.yml?query=branch%3Amaster
43+
[GitHub Actions workflow]: .github/workflows/parallel.yml
44+
45+
[Netlify docs]: https://docs.netlify.com/
46+
[Netlify badge]: https://api.netlify.com/api/v1/badges/016bd76b-ebfd-4071-94d9-8668afbb56f7/deploy-status?branch=master
47+
[Netlify log]: https://app.netlify.com/sites/cypress-example-kitchensink/deploys
48+
[Netlify workflow]: netlify.toml
49+
50+
You can find all CI results recorded on the Cypress Cloud
51+
[![Cypress Cloud](https://img.shields.io/endpoint?url=https://cloud.cypress.io/badge/simple/4b7344/master&style=flat&logo=cypress)](https://cloud.cypress.io/projects/4b7344/runs)
52+
## CI Workflow Examples
53+
54+
This table shows additional documentation-only examples of CI workflows. These are **not** live examples as in the table above and they may require modification before use.
55+
56+
CI Provider | Basic Config | Full Parallel Config
57+
:--- | :--- | :---
58+
[AWS Amplify][AWS Amplify docs] | [amplify.yml](amplify.yml) |
59+
[AWS CodeBuild][AWS CodeBuild docs] | [basic/buildspec.yml](./basic/buildspec.yml) | [buildspec.yml](buildspec.yml)
60+
[Azure Pipelines][Azure Pipelines docs] | [basic/azure-ci.yml](basic/azure-ci.yml) | [azure-ci.yml](azure-ci.yml)
61+
[Buddy.works][Buddy.works docs] | [buddy.yml](buddy.yml)
62+
[Buildkite][Buildkite docs] | [.buildkite/pipeline.yml](.buildkite/pipeline.yml)
63+
[CircleCI][CircleCi docs] | [basic/.circleci/config.yml](basic/.circleci/config.yml)
64+
[CloudBees CodeShip Pro][CloudBees CodeShip Pro docs] | [basic/codeship-pro](basic/codeship-pro)
65+
[GitHub Actions][GitHub Actions docs] | [single.yml](.github/workflows/single.yml)
66+
[GitLab][GitLab docs] | [basic/.gitlab-ci.yml](basic/.gitlab-ci.yml) | [.gitlab-ci.yml](.gitlab-ci.yml)
67+
[Jenkins][Jenkins docs] | [basic/Jenkinsfile](basic/Jenkinsfile) | [Jenkinsfile](Jenkinsfile)
68+
[Semaphore 2.0][Semaphore 2.0 docs] | [basic/.semaphore.yml](basic/.semaphore.yml) | [.semaphore/semaphore.yml](.semaphore/semaphore.yml)
69+
[Travis CI][Travis CI docs] | [basic/.travis.yml](basic/.travis.yml) | [.travis.yml](.travis.yml)
70+
71+
<!-- CI provider doc links -->
72+
[AWS Amplify docs]: https://docs.amplify.aws/
73+
[AWS CodeBuild docs]: https://docs.aws.amazon.com/codebuild/
74+
[Azure Pipelines docs]: https://learn.microsoft.com/en-us/azure/devops/pipelines/
75+
[Buddy.works docs]: https://buddy.works/docs
76+
[Buildkite docs]: https://buildkite.com/docs
77+
[CloudBees CodeShip Pro docs]: https://docs.cloudbees.com/docs/cloudbees-codeship/
78+
[GitLab docs]: https://docs.gitlab.com/ee/ci/yaml/
79+
[Jenkins docs]: https://www.jenkins.io/doc/
80+
[Semaphore 2.0 docs]: https://docs.semaphoreci.com/
81+
[Travis CI docs]: https://docs.travis-ci.com/
82+
83+
The Cypress documentation page [CI Provider Examples](https://docs.cypress.io/guides/continuous-integration/ci-provider-examples) provides some more examples with extensive guides for using Cypress with some of the most popular CI providers.
84+
85+
## CI Community Examples
86+
87+
CI | Link
88+
:--- | :--- |
89+
IBM Cloud CI (legacy) | [Cloud Foundry](https://github.com/iamgollum/cypress-example-kitchensink/tree/281-ibm-cloud-pipeline)
90+
GitLab CI (legacy) | [Example caching when installing using Yarn](https://gitlab.com/bahmutov/cypress-yarn-gitlab-ci-example)
91+
CodeFresh (legacy) | [bahmutov/cypress-codefresh-example](https://github.com/bahmutov/cypress-codefresh-example)
92+
93+
## Help + Testing
94+
95+
**If you get stuck, here is more help:**
96+
97+
* [Discord Chat](https://on.cypress.io/discord) to connect to our community
98+
* [Cypress Docs](https://on.cypress.io)
99+
100+
### 1. Fork this repo
101+
102+
If you want to experiment with running this project in Continuous Integration, you'll need to [fork](https://github.com/cypress-io/cypress-example-kitchensink#fork-destination-box) it first.
103+
104+
After forking this project in `Github`, run these commands:
105+
106+
```bash
107+
## clone this repo to a local directory
108+
git clone https://github.com/<your-username>/cypress-example-kitchensink.git
109+
110+
## cd into the cloned repo
111+
cd cypress-example-kitchensink
112+
113+
## install the node_modules
114+
npm install
115+
116+
## start the local webserver
117+
npm start
118+
```
119+
120+
The `npm start` script will spawn a webserver on port `8080` which hosts the Kitchen Sink App.
121+
122+
You can verify this by opening your browser and navigating to: [`http://localhost:8080`](http://localhost:8080)
123+
124+
You should see the Kitchen Sink App up and running. We are now ready to run Cypress tests.
125+
126+
```bash
127+
# launch the cypress test runner
128+
npm run cy:open
129+
```
130+
131+
**shortcut:** you can use command `npm run local:open` that uses [start-server-and-test](https://github.com/bahmutov/start-server-and-test) to start local server and open Cypress. When you close Cypress, the local server is stopped automatically. Similarly you can use `npm run local:run` to start the server, run Cypress tests headlessly and close the server.
132+
133+
### 2. Install & write tests in Cypress
134+
135+
[Follow these instructions to install and write tests in Cypress.](https://on.cypress.io/installing-cypress)
136+
137+
## Contributing
138+
139+
Check out the [Contributing Guideline](/CONTRIBUTING.md).
140+
141+
## Changelog
142+
143+
- after v1.0.4 at [cypress-example-kitchensink/releases](https://github.com/cypress-io/cypress-example-kitchensink/releases)
144+
- before at [CHANGELOG_OLD.md](CHANGELOG_OLD.md)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"auth": {
3+
"username": "BROWSERSTACK_USERNAME",
4+
"access_key": "BROWSERSTACK_ACCESS_KEY"
5+
},
6+
"browsers": [
7+
{
8+
"browser": "chrome",
9+
"os": "Windows 10",
10+
"versions": [
11+
"latest"
12+
]
13+
}
14+
],
15+
"run_settings": {
16+
"cypress_config_file": "cypress.config.js",
17+
"project_name": "Cypress Project",
18+
"build_name": "Cypress Demo",
19+
"exclude": [],
20+
"parallels": "20",
21+
"npm_dependencies": {
22+
},
23+
"package_config_options": {},
24+
"headless": true
25+
},
26+
"testObservability": false,
27+
"connection_settings": {
28+
"local": false,
29+
"local_identifier": null,
30+
"local_mode": null,
31+
"local_config_file": null
32+
},
33+
"disable_usage_reporting": false
34+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
'projectId': '4b7344',
3+
e2e: {
4+
setupNodeEvents(on, config) {
5+
on('task', {
6+
async 'db:seed'() {
7+
// seed database with test data
8+
const axios = require('axios');
9+
return null;
10+
},
11+
})
12+
},
13+
},
14+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/// <reference types="cypress" />
2+
//var _ = require('lodash');
3+
4+
describe('example to-do app', () => {
5+
beforeEach(() => {
6+
cy.visit('www.google.com')
7+
})
8+
9+
it('displays two todo items by default', () => {
10+
//_.chunk(['a', 'b', 'c', 'd'], 2);
11+
cy.task("db:seed");
12+
})
13+
})
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "Using fixtures to represent data",
3+
"email": "[email protected]",
4+
"body": "Fixtures are a great way to mock data for responses to routes"
5+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// ***********************************************
2+
// This example commands.js shows you how to
3+
// create various custom commands and overwrite
4+
// existing commands.
5+
//
6+
// For more comprehensive examples of custom
7+
// commands please read more here:
8+
// https://on.cypress.io/custom-commands
9+
// ***********************************************
10+
//
11+
//
12+
// -- This is a parent command --
13+
// Cypress.Commands.add('login', (email, password) => { ... })
14+
//
15+
//
16+
// -- This is a child command --
17+
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
18+
//
19+
//
20+
// -- This is a dual command --
21+
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
22+
//
23+
//
24+
// -- This will overwrite an existing command --
25+
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// ***********************************************************
2+
// This example support/component.js is processed and
3+
// loaded automatically before your test files.
4+
//
5+
// This is a great place to put global configuration and
6+
// behavior that modifies Cypress.
7+
//
8+
// You can change the location of this file or turn off
9+
// automatically serving support files with the
10+
// 'supportFile' configuration option.
11+
//
12+
// You can read more here:
13+
// https://on.cypress.io/configuration
14+
// ***********************************************************
15+
16+
// Import commands.js using ES2015 syntax:
17+
import './commands'
18+
19+
// Alternatively you can use CommonJS syntax:
20+
// require('./commands')
21+
22+
//require('browserstack-cypress-cli/bin/testObservability/cypress');
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// ***********************************************************
2+
// This example support/e2e.js is processed and
3+
// loaded automatically before your test files.
4+
//
5+
// This is a great place to put global configuration and
6+
// behavior that modifies Cypress.
7+
//
8+
// You can change the location of this file or turn off
9+
// automatically serving support files with the
10+
// 'supportFile' configuration option.
11+
//
12+
// You can read more here:
13+
// https://on.cypress.io/configuration
14+
// ***********************************************************
15+
16+
// Import commands.js using ES2015 syntax:
17+
import './commands'
18+
19+
// Alternatively you can use CommonJS syntax:
20+
// require('./commands')
21+
22+
// require('browserstack-cypress-cli/bin/testObservability/cypress');

0 commit comments

Comments
 (0)