Skip to content

Commit

Permalink
BACKLOG-22196: Fix tests (#1717)
Browse files Browse the repository at this point in the history
* BACKLOG-22196: Fix tests

* BACKLOG-22196: Fix provisioning

* BACKLOG-22196: Fix provisioning to 4.4.0 site-settings-seo

* BACKLOG-22196: Fix contentMultiLanguage.cy.ts and restore full suite in search.cy.ts

* BACKLOG-22196: Fix test in picker.cy.ts

* BACKLOG-22196: Fix test in textFieldInitializerTest.cy.ts

* BACKLOG-22196: Fix lint in textFieldInitializerTest.cy.ts

* BACKLOG-22196: Restore 82 in search.cy.ts
  • Loading branch information
cedmail authored Jan 15, 2024
1 parent b377084 commit 9c0aa46
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 25 deletions.
2 changes: 2 additions & 0 deletions tests/cypress/e2e/contentMultiLanguage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ describe('Create multi language content and verify that it is different in all l
// Will be skipped in editPresent undefined
if (s.editPresent !== undefined && s.editPresent) {
pageComposer.shouldContain(s.title);
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(5000);
pageComposer.doInsideInnerFrame(() => {
cy.get('a').contains('Read More').click();
});
Expand Down
6 changes: 3 additions & 3 deletions tests/cypress/e2e/pickers/picker.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ describe('Picker tests', () => {
});

cy.log('open file picker dialog');
const contentEditor = jcontent.createContent(contentTypes.fileReference.typeName);
let contentEditor = jcontent.createContent(contentTypes.fileReference.typeName);
let picker = contentEditor
.getPickerField(contentTypes.fileReference.fieldNodeType, contentTypes.fileReference.multiple)
.open();
Expand All @@ -165,7 +165,7 @@ describe('Picker tests', () => {

cy.log('assert created folder exists and select');
pagesAccordion.expandTreeItem('images');
pagesAccordion.getTreeItem(folderName).click().should('be.visible');
pagesAccordion.getTreeItem(folderName).should('be.visible').click();
picker.cancel();

cy.log(`delete folder '${folderName}'`);
Expand All @@ -175,7 +175,7 @@ describe('Picker tests', () => {
});

cy.reload(); // Reload to sync folder
const contentEditor = jcontent.createContent(contentTypes.fileReference.typeName);
contentEditor = jcontent.createContent(contentTypes.fileReference.typeName);

cy.log('re-open file picker');

Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/e2e/pickers/search.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('Picker tests - Search', () => {
picker.getSearchInput().should('be.empty');
});

it('Editorial Picker- Search for tab - letter by letter', () => {
it('Editorial Picker - Search for tab - letter by letter', () => {
const contentEditor = jcontent.editComponentByText('Leading by Example');
const picker = contentEditor.getPickerField('jdmix:hasLink_internalLink').open();
picker.search('t');
Expand Down
24 changes: 16 additions & 8 deletions tests/cypress/e2e/textFieldInitializerTest.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {createSite, deleteSite, enableModule} from '@jahia/cypress';
import {PageComposer} from '../page-object/pageComposer';
import {SmallTextField, DateField} from '../page-object/fields';

describe('Test the text field initializer)', () => {
const siteKey = 'extFieldInitializerTest';
describe('Test the text field initializer', () => {
const siteKey = 'textFieldInitializerTest';
const langEN = 'en';
const langFR = 'fr';
const langDE = 'de';
Expand Down Expand Up @@ -59,12 +59,14 @@ describe('Test the text field initializer)', () => {
}

pageComposer.switchLanguage(data);
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(5000);
checkValuesDisplayedInPageComposer(pageComposer, valuesToCheck, lang);
});
};

it('Check text field initializer', () => {
cy.log('Create en check initial values of extFieldInitializerTest content');
cy.log('Create en check initial values of textFieldInitializerTest content');

const initialFields = [
{
Expand Down Expand Up @@ -237,10 +239,12 @@ describe('Test the text field initializer)', () => {
contentEditorToCreate.getSmallTextField('mix:title_jcr:title').addNewValue('deutschTitle', true);
contentEditorToCreate.getLanguageSwitcher().selectLang('English');
contentEditorToCreate.create();
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(5000);
cy.log('Test initial values of textFieldInitializerTest content');
testValuesInPageComposer(pageComposer, initialDisplayedValues, [langFR, langDE, langEN]);

cy.log('Edit and save textFieldInitializerTest content');

const editFields = [
{
key: 'cent:textFieldInitializer_defaultString',
Expand Down Expand Up @@ -404,13 +408,15 @@ describe('Test the text field initializer)', () => {
contentEditorToEdit.getLanguageSwitcher().selectLang('English');
contentEditorToEdit.save();
pageComposer.refresh();
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(5000);
testValuesInPageComposer(pageComposer, displayedValues, [langFR, langDE, langEN]);

cy.log('Delete previous extFieldInitializerTest content');
pageComposer.openContextualMenuOnContent('div[path="/sites/extFieldInitializerTest/home/area-main/englishtitle"] div.gwt-HTML.x-component').delete();
pageComposer.openContextualMenuOnContent('div[path="/sites/extFieldInitializerTest/home/area-main/englishtitle"] div.gwt-HTML.x-component').deletePermanently();
cy.log('Delete previous textFieldInitializerTest content');
pageComposer.openContextualMenuOnContent(`div[path="/sites/${siteKey}/home/area-main/englishtitle"] div.gwt-HTML.x-component`).delete();
pageComposer.openContextualMenuOnContent(`div[path="/sites/${siteKey}/home/area-main/englishtitle"] div.gwt-HTML.x-component`).deletePermanently();

cy.log('Create en check new extFieldInitializerTest content');
cy.log('Create en check new textFieldInitializerTest content');

const newEditFields = [
{
Expand Down Expand Up @@ -471,6 +477,8 @@ describe('Test the text field initializer)', () => {
contentEditor.getLanguageSwitcher().selectLang('English');
contentEditor.create();
pageComposer.refresh();
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(5000);
testValuesInPageComposer(pageComposer, newDisplayedValues, [langFR, langDE, langEN]);
});
});
12 changes: 7 additions & 5 deletions tests/provisioning-manifest-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,18 @@
- importSite: "jar:mvn:org.jahia.modules/digitall/2.3.0/zip/import!/Digitall.zip"

- addMavenRepository: 'https://devtools.jahia.com/nexus/content/groups/public/'
- installBundle:
- 'mvn:org.jahia.modules/jcontent/2.12.0'
autoStart: true
uninstallPreviousVersion: true

- addMavenRepository: 'https://devtools.jahia.com/nexus/content/groups/internal@id=jahia-internal@snapshots'
username: ${env:NEXUS_USERNAME}
password: ${env:NEXUS_PASSWORD}

- installBundle:
- 'mvn:org.jahia.modules/jcontent/2.13.0-SNAPSHOT'
autoStart: true
uninstallPreviousVersion: true

- installBundle:
- 'mvn:org.jahia.modules/site-settings-seo/4.4.0-SNAPSHOT'
- 'mvn:org.jahia.modules/site-settings-seo/4.4.0'
- url: 'mvn:org.jahia.modules/qa-module'
autoStart: true
uninstallPreviousVersion: true
Expand Down
18 changes: 10 additions & 8 deletions tests/provisioning-manifest-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,23 @@
- importSite: "jar:mvn:org.jahia.modules/digitall/2.3.0/zip/import!/Digitall.zip"

- addMavenRepository: 'https://devtools.jahia.com/nexus/content/groups/public/@snapshots@noreleases'

- addMavenRepository: "https://devtools.jahia.com/nexus/content/groups/enterprise@id=jahia-enterprise@snapshots"
username: ${env:NEXUS_USERNAME}
password: ${env:NEXUS_PASSWORD}
- installBundle:
- 'mvn:org.jahia.modules/site-settings-seo/4.4.0-SNAPSHOT'
- 'mvn:org.jahia.modules/jcontent/2.12.0'
- 'mvn:org.jahia.modules/content-editor'
- 'mvn:org.jahia.test/content-editor-test-module'
- 'mvn:org.jahia.modules/site-settings-seo/4.4.0-SNAPSHOT'
autoStart: true
uninstallPreviousVersion: true

- addMavenRepository: 'https://devtools.jahia.com/nexus/content/groups/internal@id=jahia-internal@snapshots'
username: ${env:NEXUS_USERNAME}
password: ${env:NEXUS_PASSWORD}

- installBundle:
- 'mvn:org.jahia.modules/jcontent/2.13.0-SNAPSHOT'
- 'mvn:org.jahia.modules/content-editor/4.6.0-SNAPSHOT'
- 'mvn:org.jahia.test/content-editor-test-module/4.6.0-SNAPSHOT'
- 'mvn:org.jahia.modules/site-settings-seo/4.4.0'
autoStart: true
uninstallPreviousVersion: true

- installBundle:
- 'mvn:org.jahia.modules/qa-module'
autoStart: true
Expand Down

0 comments on commit 9c0aa46

Please sign in to comment.