Skip to content

Commit 6fd8eed

Browse files
committed
sitemap check,all links mirrored,video embedding + full screen,404 links reports via email ✔,
1 parent 1e5b657 commit 6fd8eed

26 files changed

+344
-110
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Dependencies
22
/node_modules
3-
3+
/Server/node_modules
44
# Production
55
/build
66

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"angular.enable-strict-mode-prompt": false
3+
}

cypress.config.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const { defineConfig } = require("cypress");
2+
3+
module.exports = defineConfig({
4+
pageLoadTimeout: 640000,
5+
e2e: {
6+
setupNodeEvents(on, config) {
7+
// implement node event listeners here
8+
},
9+
},
10+
11+
component: {
12+
devServer: {
13+
framework: "react",
14+
bundler: "webpack",
15+
},
16+
},
17+
});

cypress/e2e/sitemap.cy.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
let localUrls = [];
2+
let liveUrls = [];
3+
before(() => {
4+
cy.request({
5+
url: "https://docs.appseed.us/sitemap.xml",
6+
headers: {
7+
"Content-Type": "text/xml; charset=utf-8",
8+
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36",
9+
},
10+
})
11+
.as("sitemap")
12+
.then((response) => {
13+
liveUrls = Cypress.$(response.body)
14+
.find("loc")
15+
.toArray()
16+
.map((el) => el.innerText);
17+
});
18+
cy.request({
19+
url: "http://localhost/appSeed2/sitemap.xml",
20+
headers: {
21+
"Content-Type": "text/xml; charset=utf-8",
22+
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36",
23+
},
24+
})
25+
.as("sitemap")
26+
.then((response) => {
27+
localUrls = Cypress.$(response.body)
28+
.find("loc")
29+
.toArray()
30+
.map((el) => el.innerText);
31+
});
32+
});
33+
34+
it("Each Live Url should be included in Local sitemap", () => {
35+
liveUrls.forEach((url) => {
36+
expect(localUrls).to.include(url);
37+
});
38+
});
39+
40+
it("should succesfully return status 200 from each url in the sitemap", () => {
41+
liveUrls.forEach((url) => {
42+
let url1 = url.split("https://docs.appseed.us");
43+
cy.request({
44+
url: "http://localhost/appSeed2" + url1[1],
45+
headers: {
46+
"Content-Type": "text/html",
47+
accept: "*/*",
48+
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36",
49+
},
50+
}).then((resp) => {
51+
expect(resp.status).to.eq(200);
52+
});
53+
});
54+
});
55+
56+
it("should succesfully load each url in the sitemap", () => {
57+
liveUrls.forEach((url) => {
58+
let url1 = url.split("https://docs.appseed.us");
59+
60+
cy.visit("http://localhost/appSeed2" + url1[1]);
61+
});
62+
});

cypress/fixtures/example.json

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+
}

cypress/support/commands.js

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: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<title>Components App</title>
8+
</head>
9+
<body>
10+
<div data-cy-root></div>
11+
</body>
12+
</html>

cypress/support/component.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
import { mount } from 'cypress/react'
23+
24+
Cypress.Commands.add('mount', mount)
25+
26+
// Example use:
27+
// cy.mount(<MyComponent />)

cypress/support/e2e.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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')
File renamed without changes.

0 commit comments

Comments
 (0)