-
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.
* Acceptance tests * Changelog * Correct the compose files * Format
- Loading branch information
Showing
10 changed files
with
155 additions
and
99 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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Acceptance tests | ||
on: [push] | ||
|
||
env: | ||
ADDON_NAME: "@kitconcept/volto-highlight-block" | ||
ADDON_PATH: "volto-highlight-block" | ||
VOLTO_VERSION: "17.0.0-alpha.16" | ||
|
||
jobs: | ||
|
||
acceptance: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Install Cypress | ||
run: | | ||
cd acceptance | ||
yarn | ||
- name: "Cypress: Acceptance tests" | ||
uses: cypress-io/github-action@v5 | ||
env: | ||
BABEL_ENV: production | ||
CYPRESS_RETRIES: 2 | ||
with: | ||
parallel: false | ||
browser: chrome | ||
working-directory: acceptance | ||
spec: cypress/tests/*.js | ||
install: false | ||
start: | | ||
docker compose -f ci.yml --profile prod up | ||
wait-on: 'npx wait-on --httpTimeout 20000 http-get://localhost:55001/plone http://localhost:3000' | ||
|
||
# Upload Cypress screenshots | ||
- uses: actions/upload-artifact@v3 | ||
if: failure() | ||
with: | ||
name: cypress-screenshots-acceptance | ||
path: acceptance/cypress/screenshots | ||
|
||
# Upload Cypress videos | ||
- uses: actions/upload-artifact@v3 | ||
if: failure() | ||
with: | ||
name: cypress-videos-acceptance | ||
path: acceptance/cypress/videos |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import { getSlateEditorAndType } from '../support/slate'; | ||
|
||
context('Highlight Block Acceptance Tests', () => { | ||
beforeEach(() => { | ||
cy.visit('/'); | ||
cy.viewport('macbook-16'); | ||
cy.createContent({ | ||
contentType: 'Document', | ||
contentId: 'document', | ||
contentTitle: 'Document', | ||
path: '/', | ||
withImage: true, | ||
}); | ||
cy.autologin(); | ||
}); | ||
|
||
it('As editor I can add a Highlight block', () => { | ||
// Adding Image | ||
cy.fixture('halfdome2022.jpg').then((encodedImage) => { | ||
cy.createContent({ | ||
contentType: 'Image', | ||
contentId: 'my-image', | ||
contentTitle: 'My Image', | ||
path: '/document', | ||
bodyModifier(body) { | ||
let imageObject = { | ||
encoding: 'base64', | ||
filename: 'image.jpg', | ||
'content-type': 'image/jpg', | ||
}; | ||
body.image = { | ||
...imageObject, | ||
data: encodedImage, | ||
}; | ||
return body; | ||
}, | ||
}); | ||
}); | ||
|
||
cy.visit('/document/edit'); | ||
cy.get('.block .slate-editor [contenteditable=true]').click(); | ||
cy.get('.button .block-add-button').click({ force: true }); | ||
cy.get('.blocks-chooser .mostUsed .button.highlight').click({ | ||
force: true, | ||
}); | ||
cy.get('#sidebar').findByLabelText('Browse the site').click(); | ||
|
||
cy.findByLabelText('Browse Document').click(); | ||
cy.findByLabelText('Select My Image').dblclick(); | ||
|
||
getSlateEditorAndType( | ||
'.block.highlight .title [contenteditable=true]', | ||
'Highlight - Title', | ||
); | ||
|
||
getSlateEditorAndType( | ||
'.block.highlight .description [contenteditable=true]', | ||
'Description Text', | ||
); | ||
|
||
cy.get('.ui.checkbox:last').click({ force: true }); | ||
cy.get('#field-buttonText').type('read more'); | ||
|
||
cy.get( | ||
'.block-editor-highlight.has--descriptionColor--highlight-custom-color-1', | ||
).should('be.visible'); | ||
cy.get('.ui.circular.button.highlight-custom-color-3').click(); | ||
cy.get( | ||
'.block-editor-highlight.has--descriptionColor--highlight-custom-color-3', | ||
).should('be.visible'); | ||
|
||
cy.get('.highlight-image-wrapper > img').should('be.visible'); | ||
|
||
cy.get('.block.highlight') | ||
.contains('Highlight - Title') | ||
.should('be.visible'); | ||
cy.get('.block.highlight') | ||
.contains('Description Text') | ||
.should('be.visible'); | ||
cy.get('.block.highlight').contains('read more').should('be.visible'); | ||
|
||
cy.get('#toolbar-save').click(); | ||
|
||
cy.get( | ||
'.block.highlight.has--descriptionColor--highlight-custom-color-3', | ||
).should('be.visible'); | ||
}); | ||
}); |
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
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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
Acceptance tests @sneridagh |
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
This file was deleted.
Oops, something went wrong.