Skip to content

Commit

Permalink
BACKLOG-23136: Add new tagField cypress object (#1307)
Browse files Browse the repository at this point in the history
* Add new tagField cypress object

* Fix yarn lint
  • Loading branch information
gflores-jahia authored Oct 3, 2024
1 parent d4e90ea commit 99a1496
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions tests/.eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
dist
2 changes: 1 addition & 1 deletion tests/cypress/e2e/performance/8.1.7-performance.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ContentEditor, JContent} from '../../page-object';
import {JContent} from '../../page-object';
import {preparePerformanceTool, generateReportFile, gatherPerformanceStats} from '../../support/performanceTool';
import {Button, getComponentByRole} from '@jahia/cypress';

Expand Down
5 changes: 1 addition & 4 deletions tests/cypress/e2e/pickers/externalpicker.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import {contentTypes} from '../../fixtures/contentEditor/pickers/contentTypes';
import {assertUtils} from '../../utils/assertUtils';
import {AccordionItem} from '../../page-object/accordionItem';
import {JContent} from '../../page-object/jcontent';
import {createSite, deleteSite, Dropdown, enableModule, getComponentByRole} from '@jahia/cypress';

Expand Down Expand Up @@ -29,7 +26,7 @@ describe('Picker tests', () => {
const pickerField = jcontent
.createContent('Pickers')
.getPickerField('qant:pickers_filepicker');
const picker = pickerField.open();
pickerField.open();
getComponentByRole(Dropdown, 'picker-selector').select('Custom picker');
cy.contains('Test picker');
cy.get('button[data-sel-role="custom-selector"]').click();
Expand Down
4 changes: 2 additions & 2 deletions tests/cypress/page-object/fields/field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ export class Field extends BaseComponent {
multiple: boolean;

// eslint-disable-next-line @typescript-eslint/no-unused-vars
checkValue(string: string): void {
checkValue(text: string): void {
// Empty method
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
addNewValue(string: string): void {
addNewValue(text: string): void {
// Empty method
}
}
2 changes: 1 addition & 1 deletion tests/cypress/page-object/fields/richTextField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class RichTextField extends Field {
return cy.window().its('CKEDITOR').its('instances').then(instances => instances[Object.keys(instances)[0]].getData());
}

getElement(elementName: string): Cypress.Chainable<JQuery> {
getElement(): Cypress.Chainable<JQuery> {
return cy.window().its('CKEDITOR').its('instances').then(instances => {
const instanceOfCK = instances[Object.keys(instances)[0]];
instanceOfCK.focus();
Expand Down
8 changes: 8 additions & 0 deletions tests/cypress/page-object/fields/tagField.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {Field} from './field';

export class TagField extends Field {
addNewValue(text: string): void {
this.get().find(`#${this.fieldName}`).type(`${text}{enter}`, {delay: 500});
this.get().find(`#${this.fieldName} [role="button"]`).contains(text).should('be.visible');
}
}

0 comments on commit 99a1496

Please sign in to comment.