Skip to content

Commit

Permalink
Test core basic with prefixed site
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleybl committed Mar 14, 2024
1 parent ad3a147 commit 8c48f15
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1227,9 +1227,9 @@ jobs:
name: cypress-videos
path: packages/volto/cypress/videos

prefix:
prefix-core:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
name: Prefixed site
name: Core Basic Prefixed Site
runs-on: ubuntu-latest
timeout-minutes: 35
strategy:
Expand Down Expand Up @@ -1290,7 +1290,7 @@ jobs:
install: false
working-directory: packages/volto
browser: chrome
spec: cypress/tests/minimal/**/*.js
spec: cypress/tests/core/basic/**/*.js
config: baseUrl=http://localhost/foo
env: prefixPath=/foo
start: |
Expand Down
8 changes: 5 additions & 3 deletions packages/volto/cypress/tests/core/basic/actions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
describe('actions Tests', () => {
let prefixPath;
beforeEach(() => {
cy.autologin();
cy.createContent({
Expand All @@ -8,6 +9,7 @@ describe('actions Tests', () => {
allow_discussion: true,
});
cy.visit('/contents');
prefixPath = Cypress.env('prefixPath') || '';
});
it('copy', function () {
cy.get('tr[aria-label="/my-page-1"]').within(() => {
Expand All @@ -20,7 +22,7 @@ describe('actions Tests', () => {
cy.get('a[class="icon-align-name"]').should(
'have.attr',
'href',
'/copy_of_my-page-1/contents',
`${prefixPath}/copy_of_my-page-1/contents`,
);
});
});
Expand All @@ -44,7 +46,7 @@ describe('actions Tests', () => {
cy.get('a[class="icon-align-name"]').should(
'have.attr',
'href',
'/my-page-1/contents',
`${prefixPath}/my-page-1/contents`,
);
});
});
Expand All @@ -62,7 +64,7 @@ describe('actions Tests', () => {
cy.get('a[class="icon-align-name"]').should(
'have.attr',
'href',
'/my-page-rename/contents',
`${prefixPath}/my-page-rename/contents`,
);
});
});
Expand Down
28 changes: 17 additions & 11 deletions packages/volto/cypress/tests/core/basic/deleteItemModal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
describe('Modal View for different content types', () => {
let prefixPath;
const simpleSlateLink = (target) => {
return {
'@type': 'slate',
Expand Down Expand Up @@ -32,6 +33,7 @@ describe('Modal View for different content types', () => {
beforeEach(() => {
cy.autologin();
cy.visit('/');
prefixPath = Cypress.env('prefixPath') || '';
});
it('As editor I get a warning on deleting my page when my page is referenced in the richtext', () => {
cy.createContent({
Expand All @@ -53,7 +55,7 @@ describe('Modal View for different content types', () => {
cy.get('[aria-label="/document-linked"] > :nth-child(2)').click();
cy.get('[aria-label="Delete"]').click();
cy.get('.medium > .header').should('be.visible');
cy.get('li > [href="/document-linked"]');
cy.get(`li > [href="${prefixPath}/document-linked"]`);
});
it('As editor I get a warning on deleting my page when my News-Item is referenced in the richtext', () => {
cy.createContent({
Expand All @@ -76,7 +78,7 @@ describe('Modal View for different content types', () => {
cy.get('[aria-label="/news-item-linked"] > :nth-child(2)').click();
cy.get('[aria-label="Delete"]').click();
cy.get('.medium > .header').should('be.visible');
cy.get('li > [href="/news-item-linked"]');
cy.get(`li > [href="${prefixPath}/news-item-linked"]`);
});
it('As editor I get a warning on deleting my page when my Event is referenced in the richtext', () => {
cy.createContent({
Expand All @@ -99,7 +101,7 @@ describe('Modal View for different content types', () => {
cy.get('[aria-label="/event-linked"] > :nth-child(2)').click();
cy.get('[aria-label="Delete"]').click();
cy.get('.medium > .header').should('be.visible');
cy.get('li > [href="/event-linked"]');
cy.get(`li > [href="${prefixPath}/event-linked"]`);
});
it('As editor I get a warning on deleting my page when my File is referenced in the richtext', () => {
cy.createContent({
Expand Down Expand Up @@ -145,7 +147,7 @@ describe('Modal View for different content types', () => {
cy.get('[aria-label="/image-linked"] > :nth-child(2)').click();
cy.get('[aria-label="Delete"]').click();
cy.get('.medium > .header').should('be.visible');
cy.get('li > [href="/image-linked"]');
cy.get(`li > [href="${prefixPath}/image-linked"]`);
});
it('As editor I get a warning on deleting my page when my Link is referenced in the richtext', () => {
//Test Setup
Expand Down Expand Up @@ -173,13 +175,15 @@ describe('Modal View for different content types', () => {
cy.get('[aria-label="/link-linked"] > :nth-child(2)').click();
cy.get('[aria-label="Delete"]').click();
cy.get('.medium > .header').should('be.visible');
cy.get('li > [href="/link-linked"]');
cy.get(`li > [href="${prefixPath}/link-linked"]`);
});
});
describe('Test if different forms of Linking content appear in Delete Modal View', () => {
let prefixPath;
beforeEach(() => {
cy.autologin();
cy.visit('/');
prefixPath = Cypress.env('prefixPath') || '';
});
it('As editor I get a warning on deleting my page when my Document is referenced in the Teaser Block', () => {
cy.createContent({
Expand Down Expand Up @@ -220,7 +224,7 @@ describe('Test if different forms of Linking content appear in Delete Modal View
cy.get('[aria-label="/document-linked"] > :nth-child(2)').click();
cy.get('[aria-label="Delete"]').click();
cy.get('.medium > .header').should('be.visible');
cy.get('li > [href="/document-linked"]');
cy.get(`li > [href="${prefixPath}/document-linked"]`);
});
it('As editor I get a warning on deleting my page when my Image is referenced in the Teaser Block', () => {
cy.createContent({
Expand Down Expand Up @@ -281,10 +285,12 @@ describe('Test if different forms of Linking content appear in Delete Modal View
cy.get('[aria-label="Select Image that is linked"]').click();
cy.get('#toolbar-save').click();
cy.visit('/contents');
cy.get('[aria-label="/document-linked"] > :nth-child(2)').click();
cy.get(
`[aria-label="${prefixPath}/document-linked"] > :nth-child(2)`,
).click();
cy.get('[aria-label="Delete"]').click();
cy.get('.medium > .header').should('be.visible');
cy.get('li > [href="/document-linked"]');
cy.get(`li > [href="${prefixPath}/document-linked"]`);
});
it('As editor I get a warning on deleting my Document when my Image is referenced via Image Block', () => {
cy.createContent({
Expand All @@ -311,7 +317,7 @@ describe('Test if different forms of Linking content appear in Delete Modal View
cy.get('[aria-label="/image-linked"] > :nth-child(2)').click();
cy.get('[aria-label="Delete"]').click();
cy.get('.medium > .header').should('be.visible');
cy.get('li > [href="/image-linked"]');
cy.get(`li > [href="${prefixPath}/image-linked"]`);
});
it('As editor I get a warning on deleting my Image when my Image is referenced in the Image Block', () => {
cy.createContent({
Expand Down Expand Up @@ -349,7 +355,7 @@ describe('Test if different forms of Linking content appear in Delete Modal View
cy.get('[aria-label="/document-linked"] > :nth-child(2)').click();
cy.get('[aria-label="Delete"]').click();
cy.get('.medium > .header').should('be.visible');
cy.get('li > [href="/document-linked"]');
cy.get(`li > [href="${prefixPath}/document-linked"]`);
});
it('As an Editor I get a warning on deleting my document when it is linked somewhere via teaser block inside a grid block', () => {
cy.createContent({
Expand Down Expand Up @@ -401,6 +407,6 @@ describe('Test if different forms of Linking content appear in Delete Modal View
cy.get('[aria-label="/document-linked"] > :nth-child(2)').click();
cy.get('[aria-label="Delete"]').click();
cy.get('.medium > .header').should('be.visible');
cy.get('li > [href="/document-linked"]');
cy.get(`li > [href="${prefixPath}/document-linked"]`);
});
});

0 comments on commit 8c48f15

Please sign in to comment.