mirror of
https://github.com/typemill/typemill.git
synced 2025-07-30 19:00:32 +02:00
test seeding
This commit is contained in:
@@ -0,0 +1,129 @@
|
||||
setup: false
|
||||
language: en
|
||||
welcome: false
|
||||
title: Cypress
|
||||
author: robot
|
||||
copyright: CC-BY-ND
|
||||
year: '2017'
|
||||
langattr: en
|
||||
editor: visual
|
||||
formats:
|
||||
- markdown
|
||||
- headline
|
||||
- ulist
|
||||
- olist
|
||||
- table
|
||||
- quote
|
||||
- notice
|
||||
- image
|
||||
- video
|
||||
- file
|
||||
- toc
|
||||
- hr
|
||||
- definition
|
||||
- code
|
||||
- shortcode
|
||||
access: null
|
||||
pageaccess: null
|
||||
hrdelimiter: null
|
||||
restrictionnotice: ''
|
||||
wraprestrictionnotice: null
|
||||
headlineanchors: null
|
||||
displayErrorDetails: null
|
||||
twigcache: null
|
||||
proxy: null
|
||||
trustedproxies: ''
|
||||
headersoff: null
|
||||
urlschemes: ''
|
||||
svg: null
|
||||
recoverpw: null
|
||||
recoverfrom: ''
|
||||
recoversubject: ''
|
||||
recovermessage: ''
|
||||
securitylog: null
|
||||
oldslug: null
|
||||
refreshcache: null
|
||||
pingsitemap: null
|
||||
images:
|
||||
live:
|
||||
width: '820'
|
||||
logo: ''
|
||||
favicon: ''
|
||||
theme: cyanine
|
||||
themes:
|
||||
cyanine:
|
||||
layoutsize: standard
|
||||
blogfolder: ''
|
||||
landingpage: 'on'
|
||||
landingpageIntro: '1'
|
||||
introTitle: ''
|
||||
introMarkdown: ''
|
||||
introButtonLink: 'https://typemill.net'
|
||||
introButtonLabel: Typemill
|
||||
introImageOpacity: ''
|
||||
landingpageInfo: ''
|
||||
infoMarkdown: ''
|
||||
landingpageTeaser: ''
|
||||
teaser1title: ''
|
||||
teaser1text: ''
|
||||
teaser1link: ''
|
||||
teaser1label: ''
|
||||
teaser2title: ''
|
||||
teaser2text: ''
|
||||
teaser2link: ''
|
||||
teaser2label: ''
|
||||
teaser3title: ''
|
||||
teaser3text: ''
|
||||
teaser3link: ''
|
||||
teaser3label: ''
|
||||
landingpageContrast: ''
|
||||
contrastTitle: ''
|
||||
contrastText: ''
|
||||
contrastLink: ''
|
||||
contrastLabel: ''
|
||||
landingpageNavi: '2'
|
||||
naviTitle: 'Get Started'
|
||||
naviDepth: ''
|
||||
landingpageNews: ''
|
||||
newsHeadline: ''
|
||||
newsFolder: ''
|
||||
newsLabel: ''
|
||||
authorPosition:
|
||||
top: 'on'
|
||||
authorIntro: Writer
|
||||
datePosition:
|
||||
bottom: 'on'
|
||||
dateIntro: 'Final update'
|
||||
dateFormat: m/d/Y
|
||||
gitPosition:
|
||||
top: 'on'
|
||||
gitLink: 'https://github.com/typemill/docs'
|
||||
editText: ''
|
||||
printText: ''
|
||||
chapnum: 'on'
|
||||
expand: ''
|
||||
collapse: ''
|
||||
next: ''
|
||||
previous: ''
|
||||
footer1: ''
|
||||
footer2: ''
|
||||
footer3: ''
|
||||
copyrightlinetext: ''
|
||||
font: 'BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif'
|
||||
fontheadline: 'BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif'
|
||||
fontnavi: 'BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif'
|
||||
brandcolorprimary: ''
|
||||
fontcolorprimary: ''
|
||||
newsbackground: ''
|
||||
newscolor: ''
|
||||
brandcolortertiary: ''
|
||||
fontcolortertiary: ''
|
||||
bordercolortertiary: ''
|
||||
fontcolorlink: ''
|
||||
brandcolorsecondary: ''
|
||||
fontcolorsecondary: ''
|
||||
codebackground: ''
|
||||
codecolor: ''
|
||||
contentnavihoverbackground: ''
|
||||
contentnavihovercolor: ''
|
||||
thinbordercolor: ''
|
@@ -0,0 +1,9 @@
|
||||
username: trendschau
|
||||
email: trendschau@gmail.com
|
||||
userrole: administrator
|
||||
password: $2y$10$SMeVwJeo/5vyjeI68uFi.OJZhSR.3KQTVb5zcKF5D65eZ8CDpX29.
|
||||
lastlogin: 1646578390
|
||||
image: ''
|
||||
description: ''
|
||||
firstname: Sebastian
|
||||
lastname: Schürmanns
|
@@ -1,40 +1,43 @@
|
||||
describe("Typemill Setup with Signup", function() {
|
||||
it("validates form input", function() {
|
||||
// reset users and settings
|
||||
cy.task("resetSetup");
|
||||
// visit setup form
|
||||
cy.visit("/setup");
|
||||
// cy.visit('/setup',{ onBeforeLoad: (_contentWindow) => { Object.defineProperty(navigator, 'language', { value: 'fr-FR' }) } })
|
||||
cy.url().should("include", "/setup");
|
||||
describe("Typemill Setup with Signup", function () {
|
||||
before(function () {
|
||||
// reset users and settings
|
||||
cy.task("resetSetup");
|
||||
});
|
||||
|
||||
// add data and check attributes
|
||||
cy.get('input[name="username"]')
|
||||
.type("?1")
|
||||
.should("have.value", "?1")
|
||||
.and("have.attr", "required");
|
||||
it("validates form input", function () {
|
||||
// visit setup form
|
||||
cy.visit("/setup");
|
||||
// cy.visit('/setup',{ onBeforeLoad: (_contentWindow) => { Object.defineProperty(navigator, 'language', { value: 'fr-FR' }) } })
|
||||
cy.url().should("include", "/setup");
|
||||
|
||||
cy.get('input[name="email"]')
|
||||
.type("trendschau.net")
|
||||
.should("have.value", "trendschau.net")
|
||||
.and("have.attr", "required");
|
||||
// add data and check attributes
|
||||
cy.get('input[name="username"]')
|
||||
.type("?1")
|
||||
.should("have.value", "?1")
|
||||
.and("have.attr", "required");
|
||||
|
||||
cy.get('input[name="password"]')
|
||||
.type("pass")
|
||||
.should("have.value", "pass")
|
||||
.and("have.attr", "required");
|
||||
cy.get('input[name="email"]')
|
||||
.type("trendschau.net")
|
||||
.should("have.value", "trendschau.net")
|
||||
.and("have.attr", "required");
|
||||
|
||||
// submit and get validation errors
|
||||
cy.get("form").submit();
|
||||
cy.get("#flash-message").should(
|
||||
"contain",
|
||||
"Please check your input and try again"
|
||||
);
|
||||
cy.get(".error").should("contain", "invalid characters");
|
||||
cy.get(".error").should("contain", "e-mail is invalid");
|
||||
cy.get(".error").should("contain", "Length between 5 - 20");
|
||||
});
|
||||
cy.get('input[name="password"]')
|
||||
.type("pass")
|
||||
.should("have.value", "pass")
|
||||
.and("have.attr", "required");
|
||||
|
||||
/*
|
||||
// submit and get validation errors
|
||||
cy.get("form").submit();
|
||||
cy.get("#flash-message").should(
|
||||
"contain",
|
||||
"Please check your input and try again"
|
||||
);
|
||||
cy.get(".error").should("contain", "invalid characters");
|
||||
cy.get(".error").should("contain", "e-mail is invalid");
|
||||
cy.get(".error").should("contain", "Length between 5 - 20");
|
||||
});
|
||||
|
||||
/*
|
||||
it('fails without CSRF-token', function ()
|
||||
{
|
||||
cy.request({
|
||||
@@ -52,111 +55,111 @@ describe("Typemill Setup with Signup", function() {
|
||||
.should('include', 'The form has a timeout')
|
||||
})
|
||||
*/
|
||||
it("fails without CSRF-token", function() {
|
||||
cy.visit("/setup");
|
||||
it("fails without CSRF-token", function () {
|
||||
cy.visit("/setup");
|
||||
|
||||
// enter correct data
|
||||
cy.get('input[name="username"]').clear().type("trendschau");
|
||||
cy.get('input[name="email"]').clear().type("trendschau@gmail.com");
|
||||
cy.get('input[name="password"]').clear().type("password");
|
||||
cy.get("#csrf_value").then((elem) => {
|
||||
elem.val("wrongvalue");
|
||||
});
|
||||
|
||||
// submit and get validation errors
|
||||
cy.get("form").submit();
|
||||
cy.get("#flash-message").should("contain", "form has a timeout");
|
||||
// enter correct data
|
||||
cy.get('input[name="username"]').clear().type("trendschau");
|
||||
cy.get('input[name="email"]').clear().type("trendschau@gmail.com");
|
||||
cy.get('input[name="password"]').clear().type("password");
|
||||
cy.get("#csrf_value").then((elem) => {
|
||||
elem.val("wrongvalue");
|
||||
});
|
||||
|
||||
it("submits valid form data and visit welcome and settings page", function() {
|
||||
cy.visit("/setup");
|
||||
// submit and get validation errors
|
||||
cy.get("form").submit();
|
||||
cy.get("#flash-message").should("contain", "form has a timeout");
|
||||
});
|
||||
|
||||
// enter correct data
|
||||
cy.get('input[name="username"]').clear().type("trendschau");
|
||||
cy.get('input[name="email"]').clear().type("trendschau@gmail.com");
|
||||
cy.get('input[name="password"]').clear().type("password");
|
||||
it("submits valid form data and visit welcome and settings page", function () {
|
||||
cy.visit("/setup");
|
||||
|
||||
// submits valid form
|
||||
cy.get("form").submit();
|
||||
cy.url().should("include", "/welcome");
|
||||
cy.getCookie("typemill-session").should("exist");
|
||||
Cypress.Cookies.preserveOnce("typemill-session");
|
||||
// enter correct data
|
||||
cy.get('input[name="username"]').clear().type("trendschau");
|
||||
cy.get('input[name="email"]').clear().type("trendschau@gmail.com");
|
||||
cy.get('input[name="password"]').clear().type("password");
|
||||
|
||||
// clicks link on welcome page to settings page
|
||||
// cy.get('.button').should('contain', 'Configure your website')
|
||||
cy.get(".button").click();
|
||||
cy.url().should("include", "/tm/settings");
|
||||
});
|
||||
// submits valid form
|
||||
cy.get("form").submit();
|
||||
cy.url().should("include", "/welcome");
|
||||
cy.getCookie("typemill-session").should("exist");
|
||||
Cypress.Cookies.preserveOnce("typemill-session");
|
||||
|
||||
it("creates default settings data", function() {
|
||||
cy.get('input[name="settings[title]"]')
|
||||
.should("have.value", "TYPEMILL")
|
||||
.and("have.attr", "required");
|
||||
cy.get('input[name="settings[author]"]');
|
||||
cy.get('select[name="settings[copyright]"]');
|
||||
cy.get('input[name="settings[year]"]').should("have.attr", "required");
|
||||
cy.get('select[name="settings[language]"]');
|
||||
// cy.get('select[name="settings[langattr]"]')
|
||||
cy.get('input[name="settings[sitemap]"]')
|
||||
.should("have.value", `${Cypress.config().baseUrl}/cache/sitemap.xml`)
|
||||
.and("have.attr", "readonly");
|
||||
cy.get('input[name="settings[logo]"]');
|
||||
cy.get('input[name="settings[deletelogo]"]');
|
||||
cy.get('input[name="settings[favicon]"]');
|
||||
cy.get('input[name="settings[deletefav]"]');
|
||||
cy.get('input[name="settings[headlineanchors]"]');
|
||||
cy.get('input[name="settings[editor]"]');
|
||||
// clicks link on welcome page to settings page
|
||||
// cy.get('.button').should('contain', 'Configure your website')
|
||||
cy.get(".button").click();
|
||||
cy.url().should("include", "/tm/settings");
|
||||
});
|
||||
|
||||
cy.get('select[name="settings[language]"]')
|
||||
.select("en")
|
||||
.should("have.value", "en");
|
||||
it("creates default settings data", function () {
|
||||
cy.get('input[name="settings[title]"]')
|
||||
.should("have.value", "TYPEMILL")
|
||||
.and("have.attr", "required");
|
||||
cy.get('input[name="settings[author]"]');
|
||||
cy.get('select[name="settings[copyright]"]');
|
||||
cy.get('input[name="settings[year]"]').should("have.attr", "required");
|
||||
cy.get('select[name="settings[language]"]');
|
||||
// cy.get('select[name="settings[langattr]"]')
|
||||
cy.get('input[name="settings[sitemap]"]')
|
||||
.should("have.value", `${Cypress.config().baseUrl}/cache/sitemap.xml`)
|
||||
.and("have.attr", "readonly");
|
||||
cy.get('input[name="settings[logo]"]');
|
||||
cy.get('input[name="settings[deletelogo]"]');
|
||||
cy.get('input[name="settings[favicon]"]');
|
||||
cy.get('input[name="settings[deletefav]"]');
|
||||
cy.get('input[name="settings[headlineanchors]"]');
|
||||
cy.get('input[name="settings[editor]"]');
|
||||
|
||||
cy.get("form").submit();
|
||||
cy.get("#flash-message").should("contain", "Settings are stored");
|
||||
cy.get('select[name="settings[language]"]')
|
||||
.select("en")
|
||||
.should("have.value", "en");
|
||||
|
||||
Cypress.Cookies.preserveOnce("typemill-session");
|
||||
});
|
||||
cy.get("form").submit();
|
||||
cy.get("#flash-message").should("contain", "Settings are stored");
|
||||
|
||||
it("creates default user data", function() {
|
||||
cy.visit("/tm/user/trendschau");
|
||||
cy.url().should("include", "/tm/user/trendschau");
|
||||
cy.get('input[name="user[username]"]').should("have.value", "trendschau");
|
||||
cy.get('input[name="user[firstname]"]')
|
||||
.clear()
|
||||
.type("Sebastian")
|
||||
.should("have.value", "Sebastian");
|
||||
cy.get('input[name="user[lastname]"]')
|
||||
.clear()
|
||||
.type("Schürmanns")
|
||||
.should("have.value", "Schürmanns");
|
||||
cy.get('input[name="user[email]"]').should(
|
||||
"have.value",
|
||||
"trendschau@gmail.com"
|
||||
);
|
||||
cy.get('select[name="user[userrole]"]').should(
|
||||
"have.value",
|
||||
"administrator"
|
||||
);
|
||||
cy.get('input[name="user[password]"]').should("have.value", "");
|
||||
cy.get('input[name="user[newpassword]"]').should("have.value", "");
|
||||
Cypress.Cookies.preserveOnce("typemill-session");
|
||||
});
|
||||
|
||||
cy.get("#userform").submit();
|
||||
cy.get("#flash-message").should("contain", "Saved all changes");
|
||||
});
|
||||
it("creates default user data", function () {
|
||||
cy.visit("/tm/user/trendschau");
|
||||
cy.url().should("include", "/tm/user/trendschau");
|
||||
cy.get('input[name="user[username]"]').should("have.value", "trendschau");
|
||||
cy.get('input[name="user[firstname]"]')
|
||||
.clear()
|
||||
.type("Sebastian")
|
||||
.should("have.value", "Sebastian");
|
||||
cy.get('input[name="user[lastname]"]')
|
||||
.clear()
|
||||
.type("Schürmanns")
|
||||
.should("have.value", "Schürmanns");
|
||||
cy.get('input[name="user[email]"]').should(
|
||||
"have.value",
|
||||
"trendschau@gmail.com"
|
||||
);
|
||||
cy.get('select[name="user[userrole]"]').should(
|
||||
"have.value",
|
||||
"administrator"
|
||||
);
|
||||
cy.get('input[name="user[password]"]').should("have.value", "");
|
||||
cy.get('input[name="user[newpassword]"]').should("have.value", "");
|
||||
|
||||
it("logouts out", function() {
|
||||
// visits logout link
|
||||
cy.visit("/tm/logout");
|
||||
cy.url().should("include", "/tm/login");
|
||||
cy.get("#userform").submit();
|
||||
cy.get("#flash-message").should("contain", "Saved all changes");
|
||||
});
|
||||
|
||||
// tries to open setup form again and gets redirected to login
|
||||
cy.visit("/setup");
|
||||
cy.url().should("include", "/login");
|
||||
});
|
||||
it("logouts out", function () {
|
||||
// visits logout link
|
||||
cy.visit("/tm/logout");
|
||||
cy.url().should("include", "/tm/login");
|
||||
|
||||
it("redirects when tries to setup again", function() {
|
||||
// tries to open setup form again and gets redirected to login
|
||||
cy.visit("/setup");
|
||||
cy.url().should("include", "/login");
|
||||
});
|
||||
});
|
||||
// tries to open setup form again and gets redirected to login
|
||||
cy.visit("/setup");
|
||||
cy.url().should("include", "/login");
|
||||
});
|
||||
|
||||
it("redirects when tries to setup again", function () {
|
||||
// tries to open setup form again and gets redirected to login
|
||||
cy.visit("/setup");
|
||||
cy.url().should("include", "/login");
|
||||
});
|
||||
});
|
||||
|
@@ -1,152 +1,155 @@
|
||||
describe("Typemill Initial Frontend", function() {
|
||||
it("has startpage with navigation", function() {
|
||||
/* visit homepage */
|
||||
cy.visit("/");
|
||||
describe("Typemill Initial Frontend", function () {
|
||||
before(function () {
|
||||
cy.task("prepopulateSetup");
|
||||
});
|
||||
it("has startpage with navigation", function () {
|
||||
/* visit homepage */
|
||||
cy.visit("/");
|
||||
|
||||
/* has startpage with headline */
|
||||
cy.get("h1").contains("Typemill");
|
||||
/* has startpage with headline */
|
||||
cy.get("h1").contains("Typemill");
|
||||
|
||||
/* has start and setup button */
|
||||
cy.get("nav")
|
||||
.find("a")
|
||||
.should(($a) => {
|
||||
expect($a).to.have.length(11);
|
||||
expect($a[0].href).to.match(/welcome/);
|
||||
expect($a[1].href).to.match(/welcome\/setup-your-website/);
|
||||
expect($a[2].href).to.match(/welcome\/manage-access/);
|
||||
expect($a[3].href).to.match(/welcome\/write-content/);
|
||||
expect($a[4].href).to.match(/welcome\/get-help/);
|
||||
expect($a[5].href).to.match(/welcome\/markdown-test/);
|
||||
expect($a[6].href).to.match(/cyanine-theme/);
|
||||
expect($a[7].href).to.match(/cyanine-theme\/landingpage/);
|
||||
expect($a[8].href).to.match(/cyanine-theme\/colors-and-fonts/);
|
||||
expect($a[9].href).to.match(/cyanine-theme\/footer/);
|
||||
expect($a[10].href).to.match(/cyanine-theme\/content-elements/);
|
||||
});
|
||||
/* has start and setup button */
|
||||
cy.get("nav")
|
||||
.find("a")
|
||||
.should(($a) => {
|
||||
expect($a).to.have.length(11);
|
||||
expect($a[0].href).to.match(/welcome/);
|
||||
expect($a[1].href).to.match(/welcome\/setup-your-website/);
|
||||
expect($a[2].href).to.match(/welcome\/manage-access/);
|
||||
expect($a[3].href).to.match(/welcome\/write-content/);
|
||||
expect($a[4].href).to.match(/welcome\/get-help/);
|
||||
expect($a[5].href).to.match(/welcome\/markdown-test/);
|
||||
expect($a[6].href).to.match(/cyanine-theme/);
|
||||
expect($a[7].href).to.match(/cyanine-theme\/landingpage/);
|
||||
expect($a[8].href).to.match(/cyanine-theme\/colors-and-fonts/);
|
||||
expect($a[9].href).to.match(/cyanine-theme\/footer/);
|
||||
expect($a[10].href).to.match(/cyanine-theme\/content-elements/);
|
||||
});
|
||||
});
|
||||
|
||||
it("has error page", function () {
|
||||
cy.request({
|
||||
url: "/error",
|
||||
failOnStatusCode: false,
|
||||
}).then((resp) => {
|
||||
/* should return 404 not found */
|
||||
expect(resp.status).to.eq(404);
|
||||
});
|
||||
|
||||
it("has error page", function() {
|
||||
cy.request({
|
||||
url: "/error",
|
||||
failOnStatusCode: false,
|
||||
}).then((resp) => {
|
||||
/* should return 404 not found */
|
||||
expect(resp.status).to.eq(404);
|
||||
});
|
||||
cy.visit("/error", { failOnStatusCode: false });
|
||||
cy.url().should("include", "/error");
|
||||
|
||||
cy.visit("/error", { failOnStatusCode: false });
|
||||
cy.url().should("include", "/error");
|
||||
cy.get("h1").contains("Not Found");
|
||||
});
|
||||
|
||||
cy.get("h1").contains("Not Found");
|
||||
it("has no access to cache files", function () {
|
||||
cy.request({
|
||||
url: "/cache/structure.txt",
|
||||
failOnStatusCode: false,
|
||||
}).then((resp) => {
|
||||
// redirect status code is 302
|
||||
expect(resp.status).to.eq(403);
|
||||
});
|
||||
});
|
||||
|
||||
it("has no access to dashboard", function () {
|
||||
cy.visit("/tm/settings");
|
||||
cy.url().should("include", "/tm/login");
|
||||
});
|
||||
|
||||
it("has proper markdown test page", function () {
|
||||
cy.visit("/welcome/markdown-test");
|
||||
cy.url().should("include", "/welcome/markdown-test");
|
||||
|
||||
/* has navigation element */
|
||||
cy.get("nav").should("exist");
|
||||
|
||||
/* check if toc exists */
|
||||
cy.get(".TOC").within(($toc) => {
|
||||
/* check if a certain link in toc exists */
|
||||
cy.get("a").eq(2).should("have.attr", "href", "#h-headlines");
|
||||
});
|
||||
|
||||
it("has no access to cache files", function() {
|
||||
cy.request({
|
||||
url: "/cache/structure.txt",
|
||||
failOnStatusCode: false,
|
||||
}).then((resp) => {
|
||||
// redirect status code is 302
|
||||
expect(resp.status).to.eq(403);
|
||||
});
|
||||
/* check if corresponding anchor exists */
|
||||
cy.get("#h-headlines").should("exist");
|
||||
|
||||
/* soft linebreaks */
|
||||
cy.get("br").should("exist");
|
||||
|
||||
/* emphasis */
|
||||
cy.get("em").should("exist");
|
||||
|
||||
/* strong */
|
||||
cy.get("strong").should("exist");
|
||||
|
||||
/* ordered list */
|
||||
cy.get("ol").should("exist");
|
||||
|
||||
/* linebreak */
|
||||
cy.get("hr").should("exist");
|
||||
|
||||
/* links exists? hard to test, any idea? We need to wrap it in a div... */
|
||||
|
||||
/* images */
|
||||
cy.get("img").eq(0).should("have.attr", "alt", "alt");
|
||||
cy.get("img")
|
||||
.eq(0)
|
||||
.should("have.attr", "src")
|
||||
.should("include", "media/files/markdown.png");
|
||||
cy.get("figure")
|
||||
.eq(2)
|
||||
.should("have.id", "myid")
|
||||
.and("have.class", "otherclass");
|
||||
cy.get("img")
|
||||
.eq(2)
|
||||
.should("have.attr", "alt", "alt-text")
|
||||
.and("have.attr", "title", "my title")
|
||||
.and("have.attr", "width", "150px");
|
||||
|
||||
/* blockquote */
|
||||
cy.get("blockquote").should("exist");
|
||||
|
||||
/* has navigation element */
|
||||
cy.get(".notice1").should("exist");
|
||||
cy.get(".notice2").should("exist");
|
||||
cy.get(".notice3").should("exist");
|
||||
|
||||
/* footnote */
|
||||
cy.get("sup").eq(0).should("have.id", "fnref1:1");
|
||||
cy.get("sup")
|
||||
.eq(0)
|
||||
.within(($sup) => {
|
||||
cy.get("a")
|
||||
.eq(0)
|
||||
.should("have.attr", "href", "#fn%3A1")
|
||||
.and("have.class", "footnote-ref");
|
||||
});
|
||||
|
||||
/* abbreviation */
|
||||
cy.get("abbr").should("exist");
|
||||
|
||||
/* definition list */
|
||||
cy.get("dl").should("exist");
|
||||
|
||||
/* table */
|
||||
cy.get("table").should("exist");
|
||||
|
||||
/* code */
|
||||
cy.get("pre").should("exist");
|
||||
cy.get("code").should("exist");
|
||||
|
||||
/* math */
|
||||
cy.get(".math").should("exist");
|
||||
|
||||
/* footnote end */
|
||||
cy.get(".footnotes").within(($footnotes) => {
|
||||
cy.get("li").eq(0).should("have.id", "fn:1");
|
||||
cy.get("a")
|
||||
.eq(0)
|
||||
.should("have.class", "footnote-backref")
|
||||
.and("have.attr", "href", "#fnref1%3A1")
|
||||
.and("have.attr", "rev", "footnote");
|
||||
});
|
||||
|
||||
it("has no access to dashboard", function() {
|
||||
cy.visit("/tm/settings");
|
||||
cy.url().should("include", "/tm/login");
|
||||
});
|
||||
|
||||
it("has proper markdown test page", function() {
|
||||
cy.visit("/welcome/markdown-test");
|
||||
cy.url().should("include", "/welcome/markdown-test");
|
||||
|
||||
/* has navigation element */
|
||||
cy.get("nav").should("exist");
|
||||
|
||||
/* check if toc exists */
|
||||
cy.get(".TOC").within(($toc) => {
|
||||
/* check if a certain link in toc exists */
|
||||
cy.get("a").eq(2).should("have.attr", "href", "#h-headlines");
|
||||
});
|
||||
|
||||
/* check if corresponding anchor exists */
|
||||
cy.get("#h-headlines").should("exist");
|
||||
|
||||
/* soft linebreaks */
|
||||
cy.get("br").should("exist");
|
||||
|
||||
/* emphasis */
|
||||
cy.get("em").should("exist");
|
||||
|
||||
/* strong */
|
||||
cy.get("strong").should("exist");
|
||||
|
||||
/* ordered list */
|
||||
cy.get("ol").should("exist");
|
||||
|
||||
/* linebreak */
|
||||
cy.get("hr").should("exist");
|
||||
|
||||
/* links exists? hard to test, any idea? We need to wrap it in a div... */
|
||||
|
||||
/* images */
|
||||
cy.get("img").eq(0).should("have.attr", "alt", "alt");
|
||||
cy.get("img")
|
||||
.eq(0)
|
||||
.should("have.attr", "src")
|
||||
.should("include", "media/files/markdown.png");
|
||||
cy.get("figure")
|
||||
.eq(2)
|
||||
.should("have.id", "myid")
|
||||
.and("have.class", "otherclass");
|
||||
cy.get("img")
|
||||
.eq(2)
|
||||
.should("have.attr", "alt", "alt-text")
|
||||
.and("have.attr", "title", "my title")
|
||||
.and("have.attr", "width", "150px");
|
||||
|
||||
/* blockquote */
|
||||
cy.get("blockquote").should("exist");
|
||||
|
||||
/* has navigation element */
|
||||
cy.get(".notice1").should("exist");
|
||||
cy.get(".notice2").should("exist");
|
||||
cy.get(".notice3").should("exist");
|
||||
|
||||
/* footnote */
|
||||
cy.get("sup").eq(0).should("have.id", "fnref1:1");
|
||||
cy.get("sup")
|
||||
.eq(0)
|
||||
.within(($sup) => {
|
||||
cy.get("a")
|
||||
.eq(0)
|
||||
.should("have.attr", "href", "#fn%3A1")
|
||||
.and("have.class", "footnote-ref");
|
||||
});
|
||||
|
||||
/* abbreviation */
|
||||
cy.get("abbr").should("exist");
|
||||
|
||||
/* definition list */
|
||||
cy.get("dl").should("exist");
|
||||
|
||||
/* table */
|
||||
cy.get("table").should("exist");
|
||||
|
||||
/* code */
|
||||
cy.get("pre").should("exist");
|
||||
cy.get("code").should("exist");
|
||||
|
||||
/* math */
|
||||
cy.get(".math").should("exist");
|
||||
|
||||
/* footnote end */
|
||||
cy.get(".footnotes").within(($footnotes) => {
|
||||
cy.get("li").eq(0).should("have.id", "fn:1");
|
||||
cy.get("a")
|
||||
.eq(0)
|
||||
.should("have.class", "footnote-backref")
|
||||
.and("have.attr", "href", "#fnref1%3A1")
|
||||
.and("have.attr", "rev", "footnote");
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
const fs = require("fs");
|
||||
const fs = require("fs-extra");
|
||||
|
||||
/// <reference types="cypress" />
|
||||
// ***********************************************************
|
||||
@@ -33,6 +33,15 @@ module.exports = (on, config) => {
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
prepopulateSetup() {
|
||||
const settings = "settings";
|
||||
const settingsFixture =
|
||||
"cypress/fixtures/01_setup/prepulate_settings_seed/settings";
|
||||
// of course files need to exist in order to perform a delete
|
||||
fs.copySync(settingsFixture, settings);
|
||||
|
||||
return null;
|
||||
},
|
||||
});
|
||||
|
Reference in New Issue
Block a user