Skip to content

Commit e97f2be

Browse files
committed
Cypress Tutorial Full Course
1 parent d715478 commit e97f2be

File tree

1,306 files changed

+173718
-32
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,306 files changed

+173718
-32
lines changed

cypress.config.js

+2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ const { defineConfig } = require("cypress");
33
module.exports = defineConfig({
44
watchForFileChanges:false,
55
"chromeWebSecurity": false,
6+
reporter: 'cypress-mochawesome-reporter',
67
e2e: {
78
setupNodeEvents(on, config) {
89
// implement node event listeners here
10+
require('cypress-mochawesome-reporter/plugin')(on);
911
},
1012
},
1113
});

cypress/e2e/DataDrivenTesting1.cy.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
describe('Data Driven Test Suite',()=>{
2+
3+
let testData;
4+
5+
before('Run Before All Test',()=>{
6+
cy.fixture('datadriventesting1.json').then((jsonData)=>{
7+
testData = jsonData;
8+
})
9+
})
10+
11+
it('Data Driven Test1',()=>{
12+
13+
cy.visit('https://www.google.com/search?q=javascript+by+testers+talk');
14+
15+
cy.get('textarea[type="search"]').clear();
16+
17+
cy.get('textarea[type="search"]').type(testData.skill1);
18+
19+
cy.get('button[type="submit"]').click();
20+
})
21+
22+
})

cypress/e2e/DataDrivenTesting2.cy.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const jsonData = require('../fixtures/datadriventesting2.json')
2+
3+
describe('Data Driven Test Suite2',()=>{
4+
5+
jsonData.forEach((testData) => {
6+
7+
it('Data Driven Test2',()=>{
8+
9+
cy.visit('https://www.google.com/search?q=javascript+by+testers+talk');
10+
11+
cy.get('textarea[type="search"]').clear();
12+
13+
cy.get('textarea[type="search"]').type(testData.skill1);
14+
15+
cy.get('button[type="submit"]').click();
16+
})
17+
18+
});
19+
20+
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
describe('Suite1',()=>{
2+
3+
it('Suit1 Test1',()=>{
4+
5+
// cy.visit('https://www.youtube.com/@testerstalk');
6+
7+
cy.visit('https://www.google.com/search?q=javascript+by+testers+talk')
8+
9+
cy.get('textarea[type="search"]').then((element)=>{
10+
cy.log("Text from Google 1: "+element.text())
11+
})
12+
13+
cy.get('#APjFqb').then((element)=>{
14+
cy.log("Text from Google 2: "+element.text())
15+
})
16+
17+
//first element
18+
// cy.get('.IUOThf > a').first().click();
19+
20+
//last element
21+
//cy.get('.IUOThf > a').last().click();
22+
23+
//index element
24+
//cy.get('.IUOThf > a').eq(1).click();
25+
26+
//starts-with
27+
// cy.get('button[type^="sub"]').click();
28+
29+
//ends-with
30+
// cy.get('button[type$="mit"]').click()
31+
32+
//contains - CSS
33+
//cy.get('button[type*="ubmi"]').click()
34+
35+
//class
36+
cy.get('[class="LC20lb MBeuO DKV0Md"]').eq(1).click();
37+
38+
//contains - Cypress
39+
//cy.contains('JavaScript by Testers Talk').click();
40+
41+
// cy.get('tp-yt-paper-tab > div').eq(2).click();
42+
43+
})
44+
45+
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
describe('Suite2', () => {
2+
3+
it('Suit2 Test1', () => {
4+
5+
cy.visit('https://www.google.com/search?q=javascript+by+testers+talk')
6+
7+
cy.xpath('//*[@type="search"]').clear()
8+
9+
cy.xpath('//*[@type="search"]').type("api testing by testers talk")
10+
11+
// cy.xpath('//*[text()="Github"]').click();
12+
13+
})
14+
15+
it('Suit2 Test2', () => {
16+
17+
cy.visit('https://www.google.com/search?q=javascript+by+testers+talk')
18+
19+
cy.xpath('//*[@type="search"]').clear()
20+
21+
cy.xpath('//*[@type="search"]').type("api testing by testers talk")
22+
23+
// cy.xpath('//*[text()="Github"]').click();
24+
25+
})
26+
27+
28+
})
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"skill1":"postman by testers talk",
3+
"channel":"Testers Talk"
4+
}
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[{
2+
"skill1":"postman by testers talk",
3+
"channel":"Testers Talk"
4+
},
5+
{
6+
"skill1":"rest assured by testers talk",
7+
"channel":"Testers Talk"
8+
},
9+
{
10+
"skill1":"specflow by testers talk",
11+
"channel":"Testers Talk"
12+
},
13+
{
14+
"skill1":"easyrepro by testers talk",
15+
"channel":"Testers Talk"
16+
},
17+
{
18+
"skill1":"api testing by testers talk",
19+
"channel":"Testers Talk"
20+
},
21+
{
22+
"skill1":"javascript by testers talk",
23+
"channel":"Testers Talk"
24+
}
25+
]
Binary file not shown.
Binary file not shown.

cypress/reports/html/assets/app.css

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cypress/reports/html/assets/app.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
object-assign
3+
(c) Sindre Sorhus
4+
@license MIT
5+
*/
6+
7+
/*!
8+
Copyright (c) 2017 Jed Watson.
9+
Licensed under the MIT License (MIT), see
10+
http://jedwatson.github.io/classnames
11+
*/
12+
13+
/*! *****************************************************************************
14+
Copyright (c) Microsoft Corporation. All rights reserved.
15+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
16+
this file except in compliance with the License. You may obtain a copy of the
17+
License at http://www.apache.org/licenses/LICENSE-2.0
18+
19+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
20+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
21+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
22+
MERCHANTABLITY OR NON-INFRINGEMENT.
23+
24+
See the Apache Version 2.0 License for specific language governing permissions
25+
and limitations under the License.
26+
***************************************************************************** */
27+
28+
/*! mochawesome-report-generator 6.2.0 | https://github.com/adamgruber/mochawesome-report-generator */
29+
30+
/** @license React v0.19.1
31+
* scheduler.production.min.js
32+
*
33+
* Copyright (c) Facebook, Inc. and its affiliates.
34+
*
35+
* This source code is licensed under the MIT license found in the
36+
* LICENSE file in the root directory of this source tree.
37+
*/
38+
39+
/** @license React v16.13.1
40+
* react-dom.production.min.js
41+
*
42+
* Copyright (c) Facebook, Inc. and its affiliates.
43+
*
44+
* This source code is licensed under the MIT license found in the
45+
* LICENSE file in the root directory of this source tree.
46+
*/
47+
48+
/** @license React v16.13.1
49+
* react.production.min.js
50+
*
51+
* Copyright (c) Facebook, Inc. and its affiliates.
52+
*
53+
* This source code is licensed under the MIT license found in the
54+
* LICENSE file in the root directory of this source tree.
55+
*/
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

cypress/reports/html/index.html

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<!doctype html>
2+
<html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width, initial-scale=1"/><title>Mochawesome Report</title><link rel="stylesheet" href="assets\app.css"/></head><body data-raw="{&quot;stats&quot;:{&quot;suites&quot;:2,&quot;tests&quot;:3,&quot;passes&quot;:3,&quot;pending&quot;:0,&quot;failures&quot;:0,&quot;testsRegistered&quot;:3,&quot;passPercent&quot;:100,&quot;pendingPercent&quot;:0,&quot;other&quot;:0,&quot;hasOther&quot;:false,&quot;skipped&quot;:0,&quot;hasSkipped&quot;:false,&quot;start&quot;:&quot;2023-09-27T13:30:27.287Z&quot;,&quot;end&quot;:&quot;2023-09-27T13:31:23.695Z&quot;,&quot;duration&quot;:56408},&quot;results&quot;:[{&quot;uuid&quot;:&quot;4d00ddc0-d0c5-434d-b83f-41a793579feb&quot;,&quot;title&quot;:&quot;&quot;,&quot;fullFile&quot;:&quot;cypress\\e2e\\ReportingTests\\Suite2Tests.cy.js&quot;,&quot;file&quot;:&quot;cypress\\e2e\\ReportingTests\\Suite2Tests.cy.js&quot;,&quot;beforeHooks&quot;:[],&quot;afterHooks&quot;:[],&quot;tests&quot;:[],&quot;suites&quot;:[{&quot;uuid&quot;:&quot;7f65164a-ec27-454f-9512-9af0de50b0e1&quot;,&quot;title&quot;:&quot;Suite2&quot;,&quot;fullFile&quot;:&quot;cypress\\e2e\\ReportingTests\\Suite2Tests.cy.js&quot;,&quot;file&quot;:&quot;cypress\\e2e\\ReportingTests\\Suite2Tests.cy.js&quot;,&quot;beforeHooks&quot;:[],&quot;afterHooks&quot;:[],&quot;tests&quot;:[{&quot;title&quot;:&quot;Suit2 Test1&quot;,&quot;fullTitle&quot;:&quot;Suite2 Suit2 Test1&quot;,&quot;timedOut&quot;:null,&quot;duration&quot;:11321,&quot;state&quot;:&quot;passed&quot;,&quot;speed&quot;:&quot;slow&quot;,&quot;pass&quot;:true,&quot;fail&quot;:false,&quot;pending&quot;:false,&quot;context&quot;:null,&quot;code&quot;:&quot;cy.visit(&#x27;https://www.google.com/search?q=javascript+by+testers+talk&#x27;);\ncy.xpath(&#x27;//*[@type=\&quot;search\&quot;]&#x27;).clear();\ncy.xpath(&#x27;//*[@type=\&quot;search\&quot;]&#x27;).type(\&quot;api testing by testers talk\&quot;);\n// cy.xpath(&#x27;//*[text()=\&quot;Github\&quot;]&#x27;).click();&quot;,&quot;err&quot;:{},&quot;uuid&quot;:&quot;da5401ac-50ce-44e5-8e81-839d4d1b7fdb&quot;,&quot;parentUUID&quot;:&quot;7f65164a-ec27-454f-9512-9af0de50b0e1&quot;,&quot;isHook&quot;:false,&quot;skipped&quot;:false},{&quot;title&quot;:&quot;Suit2 Test2&quot;,&quot;fullTitle&quot;:&quot;Suite2 Suit2 Test2&quot;,&quot;timedOut&quot;:null,&quot;duration&quot;:9831,&quot;state&quot;:&quot;passed&quot;,&quot;speed&quot;:&quot;medium&quot;,&quot;pass&quot;:true,&quot;fail&quot;:false,&quot;pending&quot;:false,&quot;context&quot;:null,&quot;code&quot;:&quot;cy.visit(&#x27;https://www.google.com/search?q=javascript+by+testers+talk&#x27;);\ncy.xpath(&#x27;//*[@type=\&quot;search\&quot;]&#x27;).clear();\ncy.xpath(&#x27;//*[@type=\&quot;search\&quot;]&#x27;).type(\&quot;api testing by testers talk\&quot;);\n// cy.xpath(&#x27;//*[text()=\&quot;Github\&quot;]&#x27;).click();&quot;,&quot;err&quot;:{},&quot;uuid&quot;:&quot;be57b76b-90c7-438a-ad49-620b97198418&quot;,&quot;parentUUID&quot;:&quot;7f65164a-ec27-454f-9512-9af0de50b0e1&quot;,&quot;isHook&quot;:false,&quot;skipped&quot;:false}],&quot;suites&quot;:[],&quot;passes&quot;:[&quot;da5401ac-50ce-44e5-8e81-839d4d1b7fdb&quot;,&quot;be57b76b-90c7-438a-ad49-620b97198418&quot;],&quot;failures&quot;:[],&quot;pending&quot;:[],&quot;skipped&quot;:[],&quot;duration&quot;:21152,&quot;root&quot;:false,&quot;rootEmpty&quot;:false,&quot;_timeout&quot;:2000}],&quot;passes&quot;:[],&quot;failures&quot;:[],&quot;pending&quot;:[],&quot;skipped&quot;:[],&quot;duration&quot;:0,&quot;root&quot;:true,&quot;rootEmpty&quot;:true,&quot;_timeout&quot;:2000},{&quot;uuid&quot;:&quot;4eeb0b2c-ad6b-4ff3-ad67-7b362024b14a&quot;,&quot;title&quot;:&quot;&quot;,&quot;fullFile&quot;:&quot;cypress\\e2e\\ReportingTests\\Suite1Tests.cy.js&quot;,&quot;file&quot;:&quot;cypress\\e2e\\ReportingTests\\Suite1Tests.cy.js&quot;,&quot;beforeHooks&quot;:[],&quot;afterHooks&quot;:[],&quot;tests&quot;:[],&quot;suites&quot;:[{&quot;uuid&quot;:&quot;b78405cb-6fc6-4ba1-899c-51364f25e842&quot;,&quot;title&quot;:&quot;Suite1&quot;,&quot;fullFile&quot;:&quot;cypress\\e2e\\ReportingTests\\Suite1Tests.cy.js&quot;,&quot;file&quot;:&quot;cypress\\e2e\\ReportingTests\\Suite1Tests.cy.js&quot;,&quot;beforeHooks&quot;:[],&quot;afterHooks&quot;:[],&quot;tests&quot;:[{&quot;title&quot;:&quot;Suit1 Test1&quot;,&quot;fullTitle&quot;:&quot;Suite1 Suit1 Test1&quot;,&quot;timedOut&quot;:null,&quot;duration&quot;:21139,&quot;state&quot;:&quot;passed&quot;,&quot;speed&quot;:&quot;slow&quot;,&quot;pass&quot;:true,&quot;fail&quot;:false,&quot;pending&quot;:false,&quot;context&quot;:null,&quot;code&quot;:&quot;// cy.visit(&#x27;https://www.youtube.com/@testerstalk&#x27;);\ncy.visit(&#x27;https://www.google.com/search?q=javascript+by+testers+talk&#x27;);\ncy.get(&#x27;textarea[type=\&quot;search\&quot;]&#x27;).then(element =&gt; {\n cy.log(\&quot;Text from Google 1: \&quot; + element.text());\n});\ncy.get(&#x27;#APjFqb&#x27;).then(element =&gt; {\n cy.log(\&quot;Text from Google 2: \&quot; + element.text());\n});\n//first element\n// cy.get(&#x27;.IUOThf &gt; a&#x27;).first().click();\n//last element\n//cy.get(&#x27;.IUOThf &gt; a&#x27;).last().click();\n//index element\n//cy.get(&#x27;.IUOThf &gt; a&#x27;).eq(1).click();\n//starts-with\n// cy.get(&#x27;button[type^=\&quot;sub\&quot;]&#x27;).click();\n//ends-with\n// cy.get(&#x27;button[type$=\&quot;mit\&quot;]&#x27;).click()\n//contains - CSS\n//cy.get(&#x27;button[type*=\&quot;ubmi\&quot;]&#x27;).click()\n//class\ncy.get(&#x27;[class=\&quot;LC20lb MBeuO DKV0Md\&quot;]&#x27;).eq(1).click();\n//contains - Cypress\n//cy.contains(&#x27;JavaScript by Testers Talk&#x27;).click();\n// cy.get(&#x27;tp-yt-paper-tab &gt; div&#x27;).eq(2).click();&quot;,&quot;err&quot;:{},&quot;uuid&quot;:&quot;b7905166-c0f5-4388-b8dd-0df667052782&quot;,&quot;parentUUID&quot;:&quot;b78405cb-6fc6-4ba1-899c-51364f25e842&quot;,&quot;isHook&quot;:false,&quot;skipped&quot;:false}],&quot;suites&quot;:[],&quot;passes&quot;:[&quot;b7905166-c0f5-4388-b8dd-0df667052782&quot;],&quot;failures&quot;:[],&quot;pending&quot;:[],&quot;skipped&quot;:[],&quot;duration&quot;:21139,&quot;root&quot;:false,&quot;rootEmpty&quot;:false,&quot;_timeout&quot;:2000}],&quot;passes&quot;:[],&quot;failures&quot;:[],&quot;pending&quot;:[],&quot;skipped&quot;:[],&quot;duration&quot;:0,&quot;root&quot;:true,&quot;rootEmpty&quot;:true,&quot;_timeout&quot;:2000}],&quot;meta&quot;:{&quot;mocha&quot;:{&quot;version&quot;:&quot;7.0.1&quot;},&quot;mochawesome&quot;:{&quot;options&quot;:{&quot;quiet&quot;:false,&quot;reportFilename&quot;:&quot;mochawesome&quot;,&quot;saveHtml&quot;:false,&quot;saveJson&quot;:true,&quot;consoleReporter&quot;:&quot;spec&quot;,&quot;useInlineDiffs&quot;:false,&quot;code&quot;:true},&quot;version&quot;:&quot;7.1.3&quot;},&quot;marge&quot;:{&quot;options&quot;:{&quot;overwrite&quot;:false,&quot;html&quot;:false,&quot;json&quot;:true,&quot;reportDir&quot;:&quot;cypress\\reports\\html\\.jsons&quot;},&quot;version&quot;:&quot;6.2.0&quot;}}}" data-config="{&quot;reportFilename&quot;:&quot;index.html&quot;,&quot;reportDir&quot;:&quot;E:\\2023\\CypressFullCourseByTestersTalk\\CypressFullCourse\\cypress\\reports\\html&quot;,&quot;reportTitle&quot;:&quot;CypressFullCourse&quot;,&quot;reportPageTitle&quot;:&quot;Mochawesome Report&quot;,&quot;inline&quot;:false,&quot;inlineAssets&quot;:false,&quot;cdn&quot;:false,&quot;charts&quot;:false,&quot;enableCharts&quot;:false,&quot;code&quot;:true,&quot;enableCode&quot;:true,&quot;autoOpen&quot;:false,&quot;overwrite&quot;:true,&quot;timestamp&quot;:false,&quot;ts&quot;:false,&quot;showPassed&quot;:true,&quot;showFailed&quot;:true,&quot;showPending&quot;:true,&quot;showSkipped&quot;:false,&quot;showHooks&quot;:&quot;failed&quot;,&quot;saveJson&quot;:false,&quot;saveHtml&quot;:true,&quot;dev&quot;:false,&quot;assetsDir&quot;:&quot;E:\\2023\\CypressFullCourseByTestersTalk\\CypressFullCourse\\cypress\\reports\\html\\assets&quot;,&quot;htmlFile&quot;:&quot;E:\\2023\\CypressFullCourseByTestersTalk\\CypressFullCourse\\cypress\\reports\\html\\index.html&quot;}"><div id="report"></div><script src="assets\app.js"></script></body></html>

cypress/support/e2e.js

+3
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ if (!app.document.head.querySelector("[data-hide-command-log-request]")) {
3030

3131
//xpath
3232
require('cypress-xpath')
33+
34+
//mochawesome reporting
35+
import 'cypress-mochawesome-reporter/register'

node_modules/.bin/_mocha

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/_mocha.cmd

+17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/_mocha.ps1

+28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/flat

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/flat.cmd

+17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/flat.ps1

+28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/generate-mochawesome-report

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/generate-mochawesome-report.cmd

+17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)