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

Lines changed: 2 additions & 0 deletions
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
});
Lines changed: 22 additions & 0 deletions
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+
})
Lines changed: 20 additions & 0 deletions
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+
})
Lines changed: 45 additions & 0 deletions
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+
})
Lines changed: 28 additions & 0 deletions
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+
})
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"skill1":"postman by testers talk",
3+
"channel":"Testers Talk"
4+
}
Lines changed: 25 additions & 0 deletions
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+
]
56.3 KB
Binary file not shown.
43.3 KB
Binary file not shown.

cypress/reports/html/assets/app.css

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)