-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa0cc32
commit debaf8a
Showing
1 changed file
with
46 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,78 @@ | ||
context("Basic Acceptance Tests", () => { | ||
describe("Quote Block Tests", () => { | ||
context('Basic Acceptance Tests', () => { | ||
describe('Quote Block Tests', () => { | ||
beforeEach(() => { | ||
cy.intercept("GET", `/**/*?expand*`).as("content"); | ||
cy.intercept("GET", "/**/Document").as("schema"); | ||
cy.intercept('GET', `/**/*?expand*`).as('content'); | ||
cy.intercept('GET', '/**/Document').as('schema'); | ||
|
||
// given a logged in editor and a page in edit mode | ||
cy.autologin(); | ||
cy.createContent({ | ||
contentType: "Image", | ||
contentId: "my-image", | ||
contentTitle: "My Image", | ||
contentType: 'Image', | ||
contentId: 'my-image', | ||
contentTitle: 'My Image', | ||
}); | ||
cy.visit("/"); | ||
cy.wait("@content"); | ||
cy.visit('/'); | ||
cy.wait('@content'); | ||
}); | ||
|
||
it("As editor I can add a page with a quote block", function () { | ||
it('As editor I can add a page with a quote block', function () { | ||
// when I add a page with a quote block | ||
cy.get("#toolbar-add").click(); | ||
cy.get("#toolbar-add-document").click(); | ||
cy.get(".documentFirstHeading") | ||
.type("My Page") | ||
.get(".documentFirstHeading") | ||
.contains("My Page"); | ||
cy.get('#toolbar-add').click(); | ||
cy.get('#toolbar-add-document').click(); | ||
cy.get('.documentFirstHeading') | ||
.type('My Page') | ||
.get('.documentFirstHeading') | ||
.contains('My Page'); | ||
|
||
cy.get('[aria-multiline="false"] > p').click(); | ||
cy.get(".text-slate-editor-inner > .ui > .icon").click(); | ||
cy.get('.text-slate-editor-inner > .ui > .icon').click(); | ||
cy.get('[aria-label="Unfold Text blocks"]').click(); | ||
cy.get( | ||
'[style="transition: opacity 500ms ease 0ms;"] > :nth-child(3) > .ui' | ||
).click(); | ||
cy.get("#field-quote").click(); | ||
cy.get("#field-quote").type( | ||
"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua." | ||
); | ||
cy.get("#field-name").click(); | ||
cy.get("#field-name").type("Quotator"); | ||
cy.get("#field-additionalData").click(); | ||
cy.get("#field-additionalData").type("Position and/or Date"); | ||
cy.get('.block-editor-quote .text-slate-editor-inner .slate-editor p') | ||
.click() | ||
.type( | ||
'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.' | ||
); | ||
cy.get('#field-name').click(); | ||
cy.get('#field-name').type('Quotator'); | ||
cy.get('#field-additionalData').click(); | ||
cy.get('#field-additionalData').type('Position and/or Date'); | ||
|
||
cy.get("#toolbar-save").click(); | ||
cy.get('#toolbar-save').click(); | ||
}); | ||
|
||
it("As editor I can add an image to a quote block", function () { | ||
it('As editor I can add an image to a quote block', function () { | ||
// when I add a page with a quote block with an image | ||
cy.get("#toolbar-add").click(); | ||
cy.get("#toolbar-add-document").click(); | ||
cy.get(".documentFirstHeading") | ||
.type("My Page") | ||
.get(".documentFirstHeading") | ||
.contains("My Page"); | ||
cy.get('#toolbar-add').click(); | ||
cy.get('#toolbar-add-document').click(); | ||
cy.get('.documentFirstHeading') | ||
.type('My Page') | ||
.get('.documentFirstHeading') | ||
.contains('My Page'); | ||
|
||
cy.get('[aria-multiline="false"] > p').click(); | ||
cy.get(".text-slate-editor-inner > .ui > .icon").click(); | ||
cy.get('.text-slate-editor-inner > .ui > .icon').click(); | ||
cy.get('[aria-label="Unfold Text blocks"]').click(); | ||
cy.get( | ||
'[style="transition: opacity 500ms ease 0ms;"] > :nth-child(3) > .ui' | ||
).click(); | ||
cy.get("#field-quote").click(); | ||
cy.get("#field-quote").type( | ||
"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua." | ||
); | ||
cy.get("#field-name").click(); | ||
cy.get("#field-name").type("Quotator"); | ||
cy.get("#field-additionalData").click(); | ||
cy.get("#field-additionalData").type("Position and/or Date"); | ||
cy.get('.block-editor-quote .text-slate-editor-inner .slate-editor p') | ||
.click() | ||
.type( | ||
'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.' | ||
); | ||
cy.get('#field-name').click(); | ||
cy.get('#field-name').type('Quotator'); | ||
cy.get('#field-additionalData').click(); | ||
cy.get('#field-additionalData').type('Position and/or Date'); | ||
cy.get( | ||
"#blockform-fieldset-default > .segment > .text > .grid > .stretched > .eight > .objectbrowser-field > .ui > .icon" | ||
'#blockform-fieldset-default > .segment > .text > .grid > .stretched > .eight > .objectbrowser-field > .ui > .icon' | ||
).click(); | ||
cy.get('[title="/my-image (Image)"]').dblclick(); | ||
|
||
cy.get("#toolbar-save").click(); | ||
cy.get('#toolbar-save').click(); | ||
}); | ||
}); | ||
}); |