-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathhow_it_works_page_spec.js
56 lines (51 loc) · 1.76 KB
/
how_it_works_page_spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
describe('The how does it work page', () => {
beforeEach(function() {
cy.visit('http://localhost:3000/how-does-this-work');
});
it('Shows first step on page load', () => {
cy.get('.steps-content-container').then($el => {
expect($el).to.have.css('left', '0px');
});
});
describe('Clicking Step 1', () => {
it('Sets left position of steps-content-container to make 1st step visible', () => {
cy.get('.step-selector-btn-0').click();
cy.wait(700);
cy.get('.steps-content-container').then($el => {
expect($el).to.have.css('left', '0px');
});
});
});
describe('Clicking Step 2', () => {
it('Sets left position of steps-content-container to make 2nd step visible', () => {
cy.get('.step-selector-btn-1').click();
cy.wait(700);
cy.get('.steps-content-container').then($el => {
const width = $el.css('width');
expect($el).to.have.css('left', '-' + width);
});
});
});
describe('Clicking Step 3', () => {
it('Sets left position of steps-content-container to make 3rd step visible', () => {
cy.get('.step-selector-btn-2').click();
cy.wait(700);
cy.get('.steps-content-container').then($el => {
let width = $el.css('width');
width = parseInt(width) * 2;
expect($el).to.have.css('left', '-' + width + 'px');
});
});
});
describe('Clicking Step 4', () => {
it('Sets left position of steps-content-container to make 4th step visible', () => {
cy.get('.step-selector-btn-3').click();
cy.wait(700);
cy.get('.steps-content-container').then($el => {
let width = $el.css('width');
width = parseInt(width) * 3;
expect($el).to.have.css('left', '-' + width + 'px');
});
});
});
});