Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
}
],
"optimization": true,
"outputHashing": "all",
"outputHashing": "none",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"namedChunks": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"buildOptimizer": false,
"budgets": [
{
"type": "initial",
Expand Down
3 changes: 3 additions & 0 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"baseUrl": "http://localhost:1668"
}
59 changes: 59 additions & 0 deletions cypress/integration/sampleBlog.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/// <reference types="Cypress" />

context('check first integration test', () => {
it('check if a users exist', () => {
cy.visit('/home');
cy.get('ul>li>a')
.contains('/user')
.should(element => {
assert.isTrue(element.html() === '/user');
});
});

it('Check the list of users after navigation', () => {
cy.visit('/home');
cy.get('ul>li>a')
.contains('/user')
.click()
.get('a')
.contains('Leanne Graham');
});

it('Check is transferState exist in html', () => {
cy.visit('/user');
cy.window()
.its('scully-transfer-state')
.should('have', 'users');
});

it('Check if users dont call httprequest', () => {
cy.server();
cy.route('https://jsonplaceholder.typicode.com/users', {
onRequest: req => {
cy.log('Call http done');
expect(true).to.equal(false);
},
});
cy.visit('/user');
cy.wait(3000);
});

it('Check the list of users after navigation', () => {
cy.visit('/home');
cy.get('ul>li>a')
.contains('/user')
.click()
.get('a')
.contains('Leanne Graham')
.click()
.get('p')
.contains('Leanne Graham');
});

it('Check is transferState exist in html', () => {
cy.visit('/user/1');
cy.window()
.its('scully-transfer-state')
.should('have', 'posts');
});
});
17 changes: 17 additions & 0 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************

// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
};
25 changes: 25 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add("login", (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
20 changes: 20 additions & 0 deletions cypress/support/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands';

// Alternatively you can use CommonJS syntax:
// require('./commands')
Binary file added cypress/videos/sampleBlog.spec.js.mp4
Binary file not shown.
Loading