Skip to content

Commit

Permalink
fix: Update Acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ericof committed Feb 24, 2024
1 parent ef2a2f9 commit 3093ad4
Show file tree
Hide file tree
Showing 10 changed files with 505 additions and 379 deletions.
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,6 @@ status-test-acceptance-server: ## Status of Acceptance Server (for use it while
debug-frontend: ## Run bash in the Frontend container (for debug infrastructure purposes)
${DEV_COMPOSE} run --entrypoint bash addon-dev

.PHONY: pull-backend-image
pull-backend-image: ## Pulls and updates the backend image (for use it while developing)
docker pull ghcr.io/voltointranet-trece:latest

.PHONY: release
release: ## Release a version of the add-on
yarn release
11 changes: 2 additions & 9 deletions acceptance/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
args:
ADDON_NAME: "${ADDON_NAME}"
ADDON_PATH: "${ADDON_PATH}"
VOLTO_VERSION: ${VOLTO_VERSION:-16}
VOLTO_VERSION: ${VOLTO_VERSION:-17}
environment:
RAZZLE_INTERNAL_API_PATH: http://backend-acceptance:55001/plone
RAZZLE_API_PATH: http://localhost:55001/plone
Expand All @@ -21,14 +21,7 @@ services:
- prod

backend-acceptance:
image: plone/plone-backend:${PLONE_VERSION:-6}
command: ./bin/robot-server plone.app.robotframework.testing.VOLTO_ROBOT_TESTING
environment:
ZSERVER_HOST: 0.0.0.0
ZSERVER_PORT: 55001
ADDONS: 'plone.app.robotframework==2.0.0'
APPLY_PROFILES: plone.app.contenttypes:plone-content,plone.restapi:default,plone.volto:default-homepage
CONFIGURE_PACKAGES: plone.app.contenttypes,plone.restapi,plone.volto,plone.volto.cors
image: plone/server-acceptance:${PLONE_VERSION:-6}
ports:
- 55001:55001
profiles:
Expand Down
Binary file added acceptance/cypress/fixtures/halfdome2022.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 2 additions & 4 deletions acceptance/cypress/support/reset-fixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ function setup() {
method: 'POST',
url: `${api_url}/RobotRemote`,
headers: { Accept: 'text/xml', 'content-type': 'text/xml' },
body:
'<?xml version="1.0"?><methodCall><methodName>run_keyword</methodName><params><param><value><string>remote_zodb_setup</string></value></param><param><value><array><data><value><string>plone.app.robotframework.testing.PLONE_ROBOT_TESTING</string></value></data></array></value></param></params></methodCall>',
body: '<?xml version="1.0"?><methodCall><methodName>run_keyword</methodName><params><param><value><string>remote_zodb_setup</string></value></param><param><value><array><data><value><string>plone.app.robotframework.testing.PLONE_ROBOT_TESTING</string></value></data></array></value></param></params></methodCall>',
}).then(() => cy.log('Setting up API fixture'));
}

Expand All @@ -15,8 +14,7 @@ function teardown() {
method: 'POST',
url: `${api_url}/RobotRemote`,
headers: { Accept: 'text/xml', 'content-type': 'text/xml' },
body:
'<?xml version="1.0"?><methodCall><methodName>run_keyword</methodName><params><param><value><string>remote_zodb_teardown</string></value></param><param><value><array><data><value><string>plone.app.robotframework.testing.PLONE_ROBOT_TESTING</string></value></data></array></value></param></params></methodCall>',
body: '<?xml version="1.0"?><methodCall><methodName>run_keyword</methodName><params><param><value><string>remote_zodb_teardown</string></value></param><param><value><array><data><value><string>plone.app.robotframework.testing.PLONE_ROBOT_TESTING</string></value></data></array></value></param></params></methodCall>',
}).then(() => cy.log('Tearing down API fixture'));
}

Expand Down
14 changes: 14 additions & 0 deletions acceptance/cypress/support/slate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export const createSlateBlock = () => {
cy.get('.ui.basic.icon.button.block-add-button').first().click();
cy.get('.blocks-chooser .title').contains('Text').click();
cy.get('.ui.basic.icon.button.slate').contains('Text').click();
return getSelectedSlateEditor();
};

export const getSelectedSlateEditor = () => {
return cy.get('.slate-editor.selected [contenteditable=true]').click();
};

export const getSlateEditorAndType = (selector, type) => {
return cy.get(selector).focus().click().wait(1000).type(type).wait(1000);
};
5 changes: 0 additions & 5 deletions acceptance/cypress/tests/blocks.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ context('Blocks Acceptance Tests', () => {
path: '/document',
});
cy.visit('/document');
cy.waitForResourceToLoad('@navigation');
cy.waitForResourceToLoad('@breadcrumbs');
cy.waitForResourceToLoad('@actions');
cy.waitForResourceToLoad('@types');
cy.waitForResourceToLoad('document');
cy.navigate('/document/edit');
});

Expand Down
9 changes: 6 additions & 3 deletions acceptance/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@ services:
addon-dev:
build:
context: ../
dockerfile: ./dockerfiles/Dockerfile.dev
dockerfile: ./dockerfiles/Dockerfile.acceptance
args:
ADDON_NAME: "${ADDON_NAME}"
ADDON_PATH: "${ADDON_PATH}"
VOLTO_VERSION: ${VOLTO_VERSION:-16}
VOLTO_VERSION: ${VOLTO_VERSION:-17}
volumes:
- ${CURRENT_DIR}:/app/src/addons/${ADDON_PATH}/
environment:
RAZZLE_INTERNAL_API_PATH: http://backend-acceptance:55001/plone
RAZZLE_API_PATH: http://localhost:55001/plone
HOST: 0.0.0.0
ports:
- 3000:3000
- 3001:3001
tty: true
depends_on:
- backend-acceptance
profiles:
Expand All @@ -30,10 +32,11 @@ services:
args:
ADDON_NAME: "${ADDON_NAME}"
ADDON_PATH: "${ADDON_PATH}"
VOLTO_VERSION: ${VOLTO_VERSION:-16}
VOLTO_VERSION: ${VOLTO_VERSION:-17}
environment:
RAZZLE_INTERNAL_API_PATH: http://backend-acceptance:55001/plone
RAZZLE_API_PATH: http://localhost:55001/plone
HOST: 0.0.0.0
ports:
- 3000:3000
depends_on:
Expand Down
2 changes: 1 addition & 1 deletion acceptance/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"dependencies": {
"@plone/volto-testing": "^3.1.0"
"@plone/volto-testing": "^4.0.0"
}
}
Loading

0 comments on commit 3093ad4

Please sign in to comment.