@thegetty/quire-cli 0.20.1 → 0.20.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/bin/.DS_Store +0 -0
- package/bin/go-iiif/.DS_Store +0 -0
- package/bin/index.js +1 -1
- package/bin/starters/.DS_Store +0 -0
- package/bin/starters/default/.gitignore +14 -0
- package/bin/starters/default/config/_default/config.yml +53 -0
- package/bin/starters/default/config/development/config.yml +14 -0
- package/bin/themes/default/.gitignore +13 -0
- package/bin/themes/default/layouts/contents/single.html +2 -2
- package/bin/themes/default/layouts/data/search-index.html +1 -1
- package/bin/themes/default/layouts/partials/cite-this.html +2 -2
- package/bin/themes/default/layouts/partials/contents-list/closing-tags.html +10 -3
- package/bin/themes/default/layouts/partials/contents-list/contents-list.html +24 -9
- package/bin/themes/default/layouts/partials/contents-list/file-dir.html +7 -0
- package/bin/themes/default/layouts/partials/contents-list/file-path.html +10 -0
- package/bin/themes/default/layouts/partials/contents-list.html +207 -0
- package/bin/themes/default/layouts/partials/figure-caption.html +1 -0
- package/bin/themes/default/layouts/partials/figure-fallback.html +31 -0
- package/bin/themes/default/layouts/partials/figure-image.html +44 -0
- package/bin/themes/default/layouts/partials/figure-label.html +15 -0
- package/bin/themes/default/layouts/partials/figure-soundcloud.html +25 -0
- package/bin/themes/default/layouts/partials/figure-table.html +44 -0
- package/bin/themes/default/layouts/partials/figure-vimeo.html +24 -0
- package/bin/themes/default/layouts/partials/figure-website.html +21 -0
- package/bin/themes/default/layouts/partials/figure-youtube.html +23 -0
- package/bin/themes/default/layouts/partials/figures/media-types/vimeo.html +3 -1
- package/bin/themes/default/layouts/partials/menu.html +1 -1
- package/bin/themes/default/layouts/partials/page-bibliography.html +1 -1
- package/bin/themes/default/layouts/shortcodes/q-bibliography.html +8 -8
- package/bin/themes/default/layouts/shortcodes/q-figure-new.html +70 -0
- package/bin/themes/default/package-lock.json +13198 -0
- package/bin/themes/default/source/css/components/quire-contents-list.scss +22 -18
- package/bin/themes/default/source/css/print.scss +1 -1
- package/bin/themes/default/source/js/popup.js +14 -10
- package/bin/themes/default/static/img/icons/baseline-headset-24px.png +0 -0
- package/bin/themes/default/static/img/icons/baseline-videocam-24px.png +0 -0
- package/bin/themes/default/static/img/icons/baseline-website-24px.png +0 -0
- package/bin/themes/default/tests/.gitkeep +0 -0
- package/bin/themes/default/tests/e2e/.eslintrc.js +9 -0
- package/bin/themes/default/tests/e2e/fixtures/blns.json +483 -0
- package/bin/themes/default/tests/e2e/plugins/index.js +22 -0
- package/bin/themes/default/tests/e2e/specs/quire-contents.spec.js +52 -0
- package/bin/themes/default/tests/e2e/specs/quire-contributors.spec.js +66 -0
- package/bin/themes/default/tests/e2e/specs/quire-entry.spec.js +104 -0
- package/bin/themes/default/tests/e2e/specs/quire-essay.spec.js +105 -0
- package/bin/themes/default/tests/e2e/specs/quire-menu.spec.js +38 -0
- package/bin/themes/default/tests/e2e/specs/quire-modal.spec.js +69 -0
- package/bin/themes/default/tests/e2e/specs/quire-next-back-buttons.spec.js +27 -0
- package/bin/themes/default/tests/e2e/specs/quire-page.spec.js +28 -0
- package/bin/themes/default/tests/e2e/specs/quire-search.spec.js +48 -0
- package/bin/themes/default/tests/e2e/specs/quire-splash.spec.js +38 -0
- package/bin/themes/default/tests/e2e/support/commands.js +25 -0
- package/bin/themes/default/tests/e2e/support/index.js +20 -0
- package/package.json +1 -1
- package/bin/themes/default/static/css/application.css +0 -12072
- package/bin/themes/default/static/js/application.js +0 -92
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
describe("Quire Contents Template", () => {
|
|
2
|
+
beforeEach(() => {
|
|
3
|
+
cy.visit("/contents/");
|
|
4
|
+
});
|
|
5
|
+
|
|
6
|
+
it("will have core wrapper class 'quire__primary' with an id", () => {
|
|
7
|
+
cy.get(".quire__primary").then(element => {
|
|
8
|
+
cy.get(element).should("exist");
|
|
9
|
+
let id = element.attr("id");
|
|
10
|
+
expect(id.length > 0).to.eq(true);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it("will have a hero section with section element to display main heading", () => {
|
|
15
|
+
cy.get(".quire-page__header")
|
|
16
|
+
.find(".quire-page__header__title")
|
|
17
|
+
.then(element => {
|
|
18
|
+
cy.get(element).should("exist");
|
|
19
|
+
let id = element.attr("id");
|
|
20
|
+
expect(id.length > 0).to.eq(true);
|
|
21
|
+
cy.get(element)
|
|
22
|
+
.invoke("text")
|
|
23
|
+
.then(text => {
|
|
24
|
+
expect(text.length > 0).to.eq(true);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it("will have a 'quire-contents-list' with a unordered list of anchors", () => {
|
|
30
|
+
cy.get(".quire-contents-list")
|
|
31
|
+
.find(".menu-list ul")
|
|
32
|
+
.then(element => {
|
|
33
|
+
cy.get(element).should("exist");
|
|
34
|
+
cy.get(element)
|
|
35
|
+
.children("li")
|
|
36
|
+
.should("have.length", 10);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it("will have an unordered list of anchors that have a status code of 200", () => {
|
|
41
|
+
cy.get(".quire-contents-list ul li div")
|
|
42
|
+
.find("a")
|
|
43
|
+
.then(anchor => {
|
|
44
|
+
cy.get(anchor).should("exist");
|
|
45
|
+
let href = anchor.attr("href");
|
|
46
|
+
let url = new URL(href, window.location.origin).href;
|
|
47
|
+
cy.request(url).then(response => {
|
|
48
|
+
expect(response.status).to.eq(200);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
describe("Quire Contributors Core Elements", () => {
|
|
2
|
+
beforeEach(() => {
|
|
3
|
+
cy.visit("/contributors/");
|
|
4
|
+
});
|
|
5
|
+
|
|
6
|
+
it("quire-contributors-list will have quire-contributor with an id", () => {
|
|
7
|
+
cy.get(".quire-contributors-list").should("exist");
|
|
8
|
+
cy.get(".quire-contributors-list")
|
|
9
|
+
.find(".quire-contributor")
|
|
10
|
+
.then(element => {
|
|
11
|
+
cy.get(element).should("exist");
|
|
12
|
+
let id = element.attr("id");
|
|
13
|
+
expect(id.length > 0).to.eq(true);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("quire-contributors-list will have quire-contributor__name", () => {
|
|
18
|
+
cy.get(".quire-contributors-list").should("exist");
|
|
19
|
+
cy.get(".quire-contributors-list")
|
|
20
|
+
.find(".quire-contributor__name")
|
|
21
|
+
.then(element => {
|
|
22
|
+
cy.get(element).should("exist");
|
|
23
|
+
cy.get(element)
|
|
24
|
+
.invoke("text")
|
|
25
|
+
.then(text => {
|
|
26
|
+
expect(text.length > 0).to.eq(true);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("quire-contributor will have quire-contributor__url with a href", () => {
|
|
32
|
+
cy.get(".quire-contributor").should("exist");
|
|
33
|
+
cy.get(".quire-contributor")
|
|
34
|
+
.find(".quire-contributor__url")
|
|
35
|
+
.then(element => {
|
|
36
|
+
cy.get(element).should("exist");
|
|
37
|
+
let href = element.attr("href");
|
|
38
|
+
expect(href.length > 0).to.eq(true);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it("quire-contributors-details will have quire-contributor__pic", () => {
|
|
43
|
+
cy.get(".quire-contributor__details").should("exist");
|
|
44
|
+
cy.get(".quire-contributor__details")
|
|
45
|
+
.find(".quire-contributor__pic")
|
|
46
|
+
.then(element => {
|
|
47
|
+
cy.get(element).should("exist");
|
|
48
|
+
let src = element.attr("src");
|
|
49
|
+
expect(src.length > 0).to.eq(true);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("quire-contributors-details will have quire-contributor__bio", () => {
|
|
54
|
+
cy.get(".quire-contributor__details").should("exist");
|
|
55
|
+
cy.get(".quire-contributor__details")
|
|
56
|
+
.find(".quire-contributor__bio")
|
|
57
|
+
.then(element => {
|
|
58
|
+
cy.get(element).should("exist");
|
|
59
|
+
cy.get(element)
|
|
60
|
+
.invoke("text")
|
|
61
|
+
.then(text => {
|
|
62
|
+
expect(text.length > 0).to.eq(true);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
});
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
describe("Quire Entry Template", () => {
|
|
2
|
+
beforeEach(() => {
|
|
3
|
+
cy.visit("/catalogue/1/");
|
|
4
|
+
});
|
|
5
|
+
|
|
6
|
+
it("will go to the next image", () => {
|
|
7
|
+
cy.get("#next-image").click();
|
|
8
|
+
cy.get(".first-image").should("not.be.visible");
|
|
9
|
+
cy.get(".current-image").should("be.visible");
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it("will go to the previous image", () => {
|
|
13
|
+
cy.get("#prev-image").click();
|
|
14
|
+
cy.get(".first-image").should("not.be.visible");
|
|
15
|
+
cy.get(".last-image").should("be.visible");
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("will download the image", () => {
|
|
19
|
+
cy.get(".quire-image-control--download").then(anchor => {
|
|
20
|
+
let href = anchor.attr("href");
|
|
21
|
+
let url = new URL(href, window.location.origin).href;
|
|
22
|
+
cy.request(url).then(response => {
|
|
23
|
+
expect(response.status).to.eq(200);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* This mostly works. However in some browsers for
|
|
31
|
+
* cypress, It will error with "Failed to execute
|
|
32
|
+
* 'requestFullscreen' on 'Element': API can only be initiated by
|
|
33
|
+
* a user gesture." This test passes becasue it does not
|
|
34
|
+
* detect that fullscreen API has been initialized, but
|
|
35
|
+
* it looks that the "fullscreen" class has been added to
|
|
36
|
+
* style the button.
|
|
37
|
+
* Issues on Github => https://github.com/cypress-io/cypress/issues/311,
|
|
38
|
+
* https://github.com/cypress-io/cypress/issues/1213
|
|
39
|
+
*
|
|
40
|
+
*/
|
|
41
|
+
it("should fullscreen the image", () => {
|
|
42
|
+
cy.get("#toggleFullscreen").click();
|
|
43
|
+
cy.get("#toggleFullscreen").then(element => {
|
|
44
|
+
let c = element.attr("class");
|
|
45
|
+
expect(c.indexOf("fullscreen") !== -1).to.eq(true);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
// Test Core Elements of Entry
|
|
50
|
+
|
|
51
|
+
it("will have a main heading element", () => {
|
|
52
|
+
cy.get(".quire-page__header__title").should("exist");
|
|
53
|
+
cy.get(".quire-page__header__title")
|
|
54
|
+
.invoke("text")
|
|
55
|
+
.then(text => {
|
|
56
|
+
expect(text.length > 0).to.eq(true);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it("will have a tombstone element", () => {
|
|
61
|
+
cy.get(".quire-entry__tombstone").should("exist");
|
|
62
|
+
cy.get(".quire-entry__tombstone")
|
|
63
|
+
.invoke("text")
|
|
64
|
+
.then(text => {
|
|
65
|
+
expect(text.length > 0).to.eq(true);
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("will have a caption for the entry figure", () => {
|
|
70
|
+
cy.get(
|
|
71
|
+
".current-image div:nth-child(3) span:nth-child(1) span:nth-child(1)"
|
|
72
|
+
).should("exist");
|
|
73
|
+
cy.get(
|
|
74
|
+
".current-image div:nth-child(3) span:nth-child(1) span:nth-child(1)"
|
|
75
|
+
)
|
|
76
|
+
.invoke("text")
|
|
77
|
+
.then(text => {
|
|
78
|
+
expect(text.length > 0).to.eq(true);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it("will have core wrapper class 'quire__primary' with an id", () => {
|
|
83
|
+
cy.get(".quire__primary").then(element => {
|
|
84
|
+
cy.get(element).should("exist");
|
|
85
|
+
let id = element.attr("id");
|
|
86
|
+
expect(id.length > 0).to.eq(true);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it("will have a hero section with section element to display main heading", () => {
|
|
91
|
+
cy.get(".quire-entry__header")
|
|
92
|
+
.find(".quire-page__header__title")
|
|
93
|
+
.then(element => {
|
|
94
|
+
cy.get(element).should("exist");
|
|
95
|
+
let id = element.attr("id");
|
|
96
|
+
expect(id.length > 0).to.eq(true);
|
|
97
|
+
cy.get(element)
|
|
98
|
+
.invoke("text")
|
|
99
|
+
.then(text => {
|
|
100
|
+
expect(text.length > 0).to.eq(true);
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
});
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
describe("Quire Essay Template", () => {
|
|
2
|
+
beforeEach(() => {
|
|
3
|
+
cy.visit("/essay/");
|
|
4
|
+
});
|
|
5
|
+
|
|
6
|
+
it("figure will have an id with deepzoom or map or iiif", () => {
|
|
7
|
+
cy.get(".q-figure__wrapper")
|
|
8
|
+
.find("figure.quire-figure")
|
|
9
|
+
.then(element => {
|
|
10
|
+
cy.get(element).should("exist");
|
|
11
|
+
let id = element.attr("id");
|
|
12
|
+
expect(
|
|
13
|
+
id.indexOf("deepzoom") !== -1 ||
|
|
14
|
+
id.indexOf("map") !== -1 ||
|
|
15
|
+
id.indexOf("iiif") !== -1
|
|
16
|
+
).to.eq(true);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("figure will have caption element with text", () => {
|
|
21
|
+
cy.get(".q-figure__wrapper")
|
|
22
|
+
.find(".quire-figure__caption")
|
|
23
|
+
.then(element => {
|
|
24
|
+
cy.get(element).should("exist");
|
|
25
|
+
cy.get(element)
|
|
26
|
+
.invoke("text")
|
|
27
|
+
.then(text => {
|
|
28
|
+
expect(text.length > 0).to.eq(true);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("figure will have popup element with data-type of 'inline'", () => {
|
|
34
|
+
cy.get(".q-figure__wrapper")
|
|
35
|
+
.find(".popup")
|
|
36
|
+
.then(element => {
|
|
37
|
+
cy.get(element).should("exist");
|
|
38
|
+
let dataType = element.attr("data-type");
|
|
39
|
+
expect(dataType.indexOf("inline") !== -1).to.eq(true);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("figure will have image element with class of 'quire-figure__image' that has a source attribute", () => {
|
|
44
|
+
cy.get(".q-figure__wrapper")
|
|
45
|
+
.find(".quire-figure__image")
|
|
46
|
+
.then(element => {
|
|
47
|
+
cy.get(element).should("exist");
|
|
48
|
+
let src = element.attr("src");
|
|
49
|
+
expect(src.length > 0).to.eq(true);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("figure group will have a child of 'quire-figure--group__row'", () => {
|
|
54
|
+
cy.get("figure.quire-figure--group")
|
|
55
|
+
.find(".quire-figure--group__row")
|
|
56
|
+
.then(element => {
|
|
57
|
+
cy.get(element).should("exist");
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("'quire-figure--group__row' will have a child of 'quire-figure--group__item' and 2 groups of them for class 'quire-grid--2'", () => {
|
|
62
|
+
cy.get(".quire-figure--group__row")
|
|
63
|
+
.find(".quire-grid--2.quire-figure--group__item")
|
|
64
|
+
.then(element => {
|
|
65
|
+
cy.get(element).should("exist");
|
|
66
|
+
cy.get(element).should("have.length", 4);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it("will have core wrapper class 'quire__primary'", () => {
|
|
71
|
+
cy.get(".quire__primary").then(element => {
|
|
72
|
+
cy.get(element).should("exist");
|
|
73
|
+
let id = element.attr("id");
|
|
74
|
+
expect(id.length > 0).to.eq(true);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it("will have a hero section with section element to display main heading", () => {
|
|
79
|
+
cy.get(".quire-page__header")
|
|
80
|
+
.find(".quire-page__header__title")
|
|
81
|
+
.then(element => {
|
|
82
|
+
cy.get(element).should("exist");
|
|
83
|
+
let id = element.attr("id");
|
|
84
|
+
expect(id.length > 0).to.eq(true);
|
|
85
|
+
cy.get(element)
|
|
86
|
+
.invoke("text")
|
|
87
|
+
.then(text => {
|
|
88
|
+
expect(text.length > 0).to.eq(true);
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it("will have a hero section with section element to display contributor or author info", () => {
|
|
94
|
+
cy.get(".quire-page__header")
|
|
95
|
+
.find(".quire-page__header__contributor")
|
|
96
|
+
.then(element => {
|
|
97
|
+
cy.get(element).should("exist");
|
|
98
|
+
cy.get(element)
|
|
99
|
+
.invoke("text")
|
|
100
|
+
.then(text => {
|
|
101
|
+
expect(text.length > 0).to.eq(true);
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
describe("Quire Site Menu Core Elements and Functions", () => {
|
|
2
|
+
beforeEach(() => {
|
|
3
|
+
cy.visit("/");
|
|
4
|
+
});
|
|
5
|
+
|
|
6
|
+
it("toggles the side menu", () => {
|
|
7
|
+
cy.get("#site-menu").should("not.be.visible");
|
|
8
|
+
cy.get("#quire-controls-menu-button").click();
|
|
9
|
+
cy.get("#site-menu").should("be.visible");
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it("should have a title", () => {
|
|
13
|
+
cy.get(".quire-menu__header__title").should("exist");
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it("should have nav link list", () => {
|
|
17
|
+
cy.get("#site-menu").should("not.be.visible");
|
|
18
|
+
cy.get("#quire-controls-menu-button").click();
|
|
19
|
+
cy.get("#site-menu").should("be.visible");
|
|
20
|
+
cy.get("#nav ul li a").should("exist");
|
|
21
|
+
cy.get("#nav > ul:nth-child(2) > li:nth-child(1) > a:nth-child(1)")
|
|
22
|
+
.should("exist")
|
|
23
|
+
.click();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("should have other formats", () => {
|
|
27
|
+
cy.get("div.quire-menu__formats:nth-child(3) h6").should("exist");
|
|
28
|
+
cy.get("div.quire-menu__formats:nth-child(3) ul li").should(
|
|
29
|
+
"have.length",
|
|
30
|
+
3
|
|
31
|
+
);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("should have cite this page", () => {
|
|
35
|
+
cy.get("div.quire-menu__formats:nth-child(4) h6").should("exist");
|
|
36
|
+
cy.get("div.quire-menu__formats:nth-child(4) div").should("have.length", 2);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
describe("Quire Modal Image viewer Core Functions", () => {
|
|
2
|
+
beforeEach(() => {
|
|
3
|
+
cy.visit("/essay/");
|
|
4
|
+
});
|
|
5
|
+
|
|
6
|
+
// click 1st image and open modal viewer
|
|
7
|
+
it("open modal image viewer", () => {
|
|
8
|
+
cy.get(".mfp-content").should("not.be.visible");
|
|
9
|
+
cy.get(
|
|
10
|
+
"#content div div.content figure.quire-figure.is-pulled-center"
|
|
11
|
+
).click();
|
|
12
|
+
cy.get(".mfp-content").should("be.visible");
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
// click 1st image and open modal viewer and go to next image
|
|
16
|
+
it("open modal image viewer and go to next image", async () => {
|
|
17
|
+
cy.get(".mfp-content").should("not.be.visible");
|
|
18
|
+
cy.get(
|
|
19
|
+
"#content div div.content figure.quire-figure.is-pulled-center"
|
|
20
|
+
).click();
|
|
21
|
+
cy.get(".mfp-content").should("be.visible");
|
|
22
|
+
cy.get(".mfp-arrow-right").click();
|
|
23
|
+
cy.get(".quire-counter-container span").then(element => {
|
|
24
|
+
let title = element.attr("title");
|
|
25
|
+
expect(title.indexOf("2 of 8") !== -1).to.eq(true);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// click 1st image and open modal viewer and got to the previous image
|
|
30
|
+
it("open modal image viewer and go to previous image", async () => {
|
|
31
|
+
cy.get(".mfp-content").should("not.be.visible");
|
|
32
|
+
cy.get(
|
|
33
|
+
"#content div div.content figure.quire-figure.is-pulled-center"
|
|
34
|
+
).click();
|
|
35
|
+
cy.get(".mfp-content").should("be.visible");
|
|
36
|
+
cy.get(".mfp-arrow-left").click();
|
|
37
|
+
cy.get(".quire-counter-container span").then(element => {
|
|
38
|
+
let title = element.attr("title");
|
|
39
|
+
expect(title.indexOf("8 of 8") !== -1).to.eq(true);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* This mostly works. However in some browsers for
|
|
46
|
+
* cypress, it will warn with "Failed to execute
|
|
47
|
+
* 'requestFullscreen' on 'Element': API can only be initiated by
|
|
48
|
+
* a user gesture." This test passes becasue it does not
|
|
49
|
+
* detect that fullscreen API has been initialized, but
|
|
50
|
+
* it looks that the "fullscreen" class has been added to
|
|
51
|
+
* style the button.
|
|
52
|
+
* Issues on Github => https://github.com/cypress-io/cypress/issues/311,
|
|
53
|
+
* https://github.com/cypress-io/cypress/issues/1213
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
56
|
+
// click 1st image and open modal viewer and click full screen button
|
|
57
|
+
it("open modal image viewer and click full screen button", async () => {
|
|
58
|
+
cy.get(".mfp-content").should("not.be.visible");
|
|
59
|
+
cy.get(
|
|
60
|
+
"#content div div.content figure.quire-figure.is-pulled-center"
|
|
61
|
+
).click();
|
|
62
|
+
cy.get(".mfp-content").should("be.visible");
|
|
63
|
+
cy.get("#toggleFullscreen").click();
|
|
64
|
+
cy.get("#toggleFullscreen").then(element => {
|
|
65
|
+
let c = element.attr("class");
|
|
66
|
+
expect(c.indexOf("fullscreen") !== -1).to.eq(true);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
describe("Quire < Prev Next > Buttons", () => {
|
|
2
|
+
beforeEach(() => {
|
|
3
|
+
cy.visit("/contents/");
|
|
4
|
+
});
|
|
5
|
+
|
|
6
|
+
it("will have a 'quire-contents-buttons' with 2 buttons", () => {
|
|
7
|
+
cy.get(".quire-contents-buttons ul")
|
|
8
|
+
.find(".quire-nav-button a")
|
|
9
|
+
.then(anchor => {
|
|
10
|
+
cy.get(anchor).should("exist");
|
|
11
|
+
cy.get(anchor).should("have.length", 2);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it("Both buttons will link to pages that have a status code of 200", () => {
|
|
16
|
+
cy.get(".quire-contents-buttons ul")
|
|
17
|
+
.find(".quire-nav-button a")
|
|
18
|
+
.then(anchor => {
|
|
19
|
+
cy.get(anchor).should("exist");
|
|
20
|
+
let href = anchor.attr("href");
|
|
21
|
+
let url = new URL(href, window.location.origin).href;
|
|
22
|
+
cy.request(url).then(response => {
|
|
23
|
+
expect(response.status).to.eq(200);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
describe("Quire Page Template", () => {
|
|
2
|
+
beforeEach(() => {
|
|
3
|
+
cy.visit("/contributors/");
|
|
4
|
+
});
|
|
5
|
+
|
|
6
|
+
it("will have core wrapper class 'quire__primary' with an id", () => {
|
|
7
|
+
cy.get(".quire__primary").then(element => {
|
|
8
|
+
cy.get(element).should("exist");
|
|
9
|
+
let id = element.attr("id");
|
|
10
|
+
expect(id.length > 0).to.eq(true);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it("will have a hero section with section element to display main heading", () => {
|
|
15
|
+
cy.get(".quire-page__header")
|
|
16
|
+
.find(".quire-page__header__title")
|
|
17
|
+
.then(element => {
|
|
18
|
+
cy.get(element).should("exist");
|
|
19
|
+
let id = element.attr("id");
|
|
20
|
+
expect(id.length > 0).to.eq(true);
|
|
21
|
+
cy.get(element)
|
|
22
|
+
.invoke("text")
|
|
23
|
+
.then(text => {
|
|
24
|
+
expect(text.length > 0).to.eq(true);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
describe("Quire Site Search Core Functions", () => {
|
|
2
|
+
beforeEach(() => {
|
|
3
|
+
cy.visit("/");
|
|
4
|
+
});
|
|
5
|
+
|
|
6
|
+
it("should open search", () => {
|
|
7
|
+
cy.get("#js-search").should("not.be.visible");
|
|
8
|
+
cy.get(".search-button").click();
|
|
9
|
+
cy.get("#js-search").should("be.visible");
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it("should perform a search", () => {
|
|
13
|
+
cy.get("#js-search").should("not.be.visible");
|
|
14
|
+
cy.get(".search-button").click();
|
|
15
|
+
cy.get("#js-search").should("be.visible");
|
|
16
|
+
cy.get("input[name=search]").type("Walker Evans");
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("should click a search link", () => {
|
|
20
|
+
cy.get("#js-search").should("not.be.visible");
|
|
21
|
+
cy.get(".search-button").click();
|
|
22
|
+
cy.get("#js-search").should("be.visible");
|
|
23
|
+
cy.get("input[name=search]").type("Walker Evans");
|
|
24
|
+
cy.get("li.quire-search__inner__list-item:nth-child(1) a:nth-child(1)")
|
|
25
|
+
.should("exist")
|
|
26
|
+
.click();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it("search.json data and element should exist", () => {
|
|
30
|
+
cy.get("#js-search").should("exist");
|
|
31
|
+
cy.get("#js-search").then(element => {
|
|
32
|
+
cy.get(element).should("exist");
|
|
33
|
+
let dataSearchindex = element.attr("data-search-index");
|
|
34
|
+
expect(dataSearchindex.length > 0).to.eq(true);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("will check that search.json actually exists", () => {
|
|
39
|
+
cy.get("#js-search").should("exist");
|
|
40
|
+
cy.get("#js-search").then(element => {
|
|
41
|
+
let href = element.attr("data-search-index");
|
|
42
|
+
let url = new URL(href, window.location.origin).href;
|
|
43
|
+
cy.request(url).then(response => {
|
|
44
|
+
expect(response.status).to.eq(200);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
describe("Quire Splash Page Tempalte", () => {
|
|
2
|
+
beforeEach(() => {
|
|
3
|
+
cy.visit("/intro/");
|
|
4
|
+
});
|
|
5
|
+
|
|
6
|
+
it("figure will have popup element with data-type of 'inline'", () => {
|
|
7
|
+
cy.get(".q-figure__wrapper")
|
|
8
|
+
.find(".popup")
|
|
9
|
+
.then(element => {
|
|
10
|
+
cy.get(element).should("exist");
|
|
11
|
+
let dataType = element.attr("data-type");
|
|
12
|
+
expect(dataType.indexOf("inline") !== -1).to.eq(true);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it("will have core wrapper class 'quire__primary'", () => {
|
|
17
|
+
cy.get(".quire__primary").then(element => {
|
|
18
|
+
cy.get(element).should("exist");
|
|
19
|
+
let id = element.attr("id");
|
|
20
|
+
expect(id.length > 0).to.eq(true);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("will have a hero section with section element to display main heading", () => {
|
|
25
|
+
cy.get(".quire-page__header")
|
|
26
|
+
.find(".quire-page__header__title")
|
|
27
|
+
.then(element => {
|
|
28
|
+
cy.get(element).should("exist");
|
|
29
|
+
let id = element.attr("id");
|
|
30
|
+
expect(id.length > 0).to.eq(true);
|
|
31
|
+
cy.get(element)
|
|
32
|
+
.invoke("text")
|
|
33
|
+
.then(text => {
|
|
34
|
+
expect(text.length > 0).to.eq(true);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -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 is will overwrite an existing command --
|
|
25
|
+
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// ***********************************************************
|
|
2
|
+
// This example support/index.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')
|