@oracle/oraclejet-webdriver 10.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +16 -0
- package/bin/generate +509 -0
- package/bin/generate-jet +163 -0
- package/bin/templates/baseclass.ts-template +13 -0
- package/bin/templates/class.ts-template +12 -0
- package/bin/templates/element-test.spec.ts-template +28 -0
- package/bin/templates/index.ts-template +27 -0
- package/bin/templates/jetcomponents.json +71 -0
- package/bin/templates/package.json-template +15 -0
- package/bin/templates/tsconfig.json-template +19 -0
- package/elements/OjWebElement.js +232 -0
- package/elements/OjWebElement.js.map +1 -0
- package/elements/OjWebElement.ts +674 -0
- package/elements/index.js +214 -0
- package/elements/index.js.map +1 -0
- package/elements/index.ts +75 -0
- package/elements/oj-accordion/OjAccordion.js +8 -0
- package/elements/oj-accordion/OjAccordion.js.map +1 -0
- package/elements/oj-accordion/OjAccordion.ts +12 -0
- package/elements/oj-accordion/OjAccordionBase.js +20 -0
- package/elements/oj-accordion/OjAccordionBase.js.map +1 -0
- package/elements/oj-accordion/OjAccordionBase.ts +48 -0
- package/elements/oj-accordion/index.js +17 -0
- package/elements/oj-accordion/index.js.map +1 -0
- package/elements/oj-accordion/index.ts +27 -0
- package/elements/oj-button/OjButton.js +20 -0
- package/elements/oj-button/OjButton.js.map +1 -0
- package/elements/oj-button/OjButton.ts +35 -0
- package/elements/oj-button/OjButtonBase.js +23 -0
- package/elements/oj-button/OjButtonBase.js.map +1 -0
- package/elements/oj-button/OjButtonBase.ts +57 -0
- package/elements/oj-button/index.js +17 -0
- package/elements/oj-button/index.js.map +1 -0
- package/elements/oj-button/index.ts +27 -0
- package/elements/oj-buttonset-many/OjButtonsetMany.js +8 -0
- package/elements/oj-buttonset-many/OjButtonsetMany.js.map +1 -0
- package/elements/oj-buttonset-many/OjButtonsetMany.ts +11 -0
- package/elements/oj-buttonset-many/OjButtonsetManyBase.js +35 -0
- package/elements/oj-buttonset-many/OjButtonsetManyBase.js.map +1 -0
- package/elements/oj-buttonset-many/OjButtonsetManyBase.ts +93 -0
- package/elements/oj-buttonset-many/index.js +17 -0
- package/elements/oj-buttonset-many/index.js.map +1 -0
- package/elements/oj-buttonset-many/index.ts +27 -0
- package/elements/oj-buttonset-one/OjButtonsetOne.js +8 -0
- package/elements/oj-buttonset-one/OjButtonsetOne.js.map +1 -0
- package/elements/oj-buttonset-one/OjButtonsetOne.ts +11 -0
- package/elements/oj-buttonset-one/OjButtonsetOneBase.js +35 -0
- package/elements/oj-buttonset-one/OjButtonsetOneBase.js.map +1 -0
- package/elements/oj-buttonset-one/OjButtonsetOneBase.ts +93 -0
- package/elements/oj-buttonset-one/index.js +17 -0
- package/elements/oj-buttonset-one/index.js.map +1 -0
- package/elements/oj-buttonset-one/index.ts +27 -0
- package/elements/oj-chart/OjChart.js +8 -0
- package/elements/oj-chart/OjChart.js.map +1 -0
- package/elements/oj-chart/OjChart.ts +12 -0
- package/elements/oj-chart/OjChartBase.js +170 -0
- package/elements/oj-chart/OjChartBase.js.map +1 -0
- package/elements/oj-chart/OjChartBase.ts +2468 -0
- package/elements/oj-chart/index.js +17 -0
- package/elements/oj-chart/index.js.map +1 -0
- package/elements/oj-chart/index.ts +27 -0
- package/elements/oj-checkboxset/OjCheckboxset.js +39 -0
- package/elements/oj-checkboxset/OjCheckboxset.js.map +1 -0
- package/elements/oj-checkboxset/OjCheckboxset.ts +74 -0
- package/elements/oj-checkboxset/OjCheckboxsetBase.js +68 -0
- package/elements/oj-checkboxset/OjCheckboxsetBase.js.map +1 -0
- package/elements/oj-checkboxset/OjCheckboxsetBase.ts +262 -0
- package/elements/oj-checkboxset/index.js +17 -0
- package/elements/oj-checkboxset/index.js.map +1 -0
- package/elements/oj-checkboxset/index.ts +27 -0
- package/elements/oj-collapsible/OjCollapsible.js +23 -0
- package/elements/oj-collapsible/OjCollapsible.js.map +1 -0
- package/elements/oj-collapsible/OjCollapsible.ts +36 -0
- package/elements/oj-collapsible/OjCollapsibleBase.js +23 -0
- package/elements/oj-collapsible/OjCollapsibleBase.js.map +1 -0
- package/elements/oj-collapsible/OjCollapsibleBase.ts +57 -0
- package/elements/oj-collapsible/index.js +17 -0
- package/elements/oj-collapsible/index.js.map +1 -0
- package/elements/oj-collapsible/index.ts +27 -0
- package/elements/oj-color-palette/OjColorPalette.js +8 -0
- package/elements/oj-color-palette/OjColorPalette.js.map +1 -0
- package/elements/oj-color-palette/OjColorPalette.ts +12 -0
- package/elements/oj-color-palette/OjColorPaletteBase.js +65 -0
- package/elements/oj-color-palette/OjColorPaletteBase.js.map +1 -0
- package/elements/oj-color-palette/OjColorPaletteBase.ts +235 -0
- package/elements/oj-color-palette/index.js +17 -0
- package/elements/oj-color-palette/index.js.map +1 -0
- package/elements/oj-color-palette/index.ts +27 -0
- package/elements/oj-color-spectrum/OjColorSpectrum.js +8 -0
- package/elements/oj-color-spectrum/OjColorSpectrum.js.map +1 -0
- package/elements/oj-color-spectrum/OjColorSpectrum.ts +12 -0
- package/elements/oj-color-spectrum/OjColorSpectrumBase.js +56 -0
- package/elements/oj-color-spectrum/OjColorSpectrumBase.js.map +1 -0
- package/elements/oj-color-spectrum/OjColorSpectrumBase.ts +210 -0
- package/elements/oj-color-spectrum/index.js +17 -0
- package/elements/oj-color-spectrum/index.js.map +1 -0
- package/elements/oj-color-spectrum/index.ts +27 -0
- package/elements/oj-combobox-many/OjComboboxMany.js +51 -0
- package/elements/oj-combobox-many/OjComboboxMany.js.map +1 -0
- package/elements/oj-combobox-many/OjComboboxMany.ts +80 -0
- package/elements/oj-combobox-many/OjComboboxManyBase.js +98 -0
- package/elements/oj-combobox-many/OjComboboxManyBase.js.map +1 -0
- package/elements/oj-combobox-many/OjComboboxManyBase.ts +428 -0
- package/elements/oj-combobox-many/index.js +17 -0
- package/elements/oj-combobox-many/index.js.map +1 -0
- package/elements/oj-combobox-many/index.ts +27 -0
- package/elements/oj-combobox-one/OjComboboxOne.js +49 -0
- package/elements/oj-combobox-one/OjComboboxOne.js.map +1 -0
- package/elements/oj-combobox-one/OjComboboxOne.ts +74 -0
- package/elements/oj-combobox-one/OjComboboxOneBase.js +101 -0
- package/elements/oj-combobox-one/OjComboboxOneBase.js.map +1 -0
- package/elements/oj-combobox-one/OjComboboxOneBase.ts +437 -0
- package/elements/oj-combobox-one/index.js +17 -0
- package/elements/oj-combobox-one/index.js.map +1 -0
- package/elements/oj-combobox-one/index.ts +27 -0
- package/elements/oj-conveyor-belt/OjConveyorBelt.js +16 -0
- package/elements/oj-conveyor-belt/OjConveyorBelt.js.map +1 -0
- package/elements/oj-conveyor-belt/OjConveyorBelt.ts +30 -0
- package/elements/oj-conveyor-belt/OjConveyorBeltBase.js +29 -0
- package/elements/oj-conveyor-belt/OjConveyorBeltBase.js.map +1 -0
- package/elements/oj-conveyor-belt/OjConveyorBeltBase.ts +87 -0
- package/elements/oj-conveyor-belt/index.js +17 -0
- package/elements/oj-conveyor-belt/index.js.map +1 -0
- package/elements/oj-conveyor-belt/index.ts +27 -0
- package/elements/oj-data-grid/OjDataGrid.js +198 -0
- package/elements/oj-data-grid/OjDataGrid.js.map +1 -0
- package/elements/oj-data-grid/OjDataGrid.ts +279 -0
- package/elements/oj-data-grid/OjDataGridBase.js +65 -0
- package/elements/oj-data-grid/OjDataGridBase.js.map +1 -0
- package/elements/oj-data-grid/OjDataGridBase.ts +705 -0
- package/elements/oj-data-grid/index.js +17 -0
- package/elements/oj-data-grid/index.js.map +1 -0
- package/elements/oj-data-grid/index.ts +27 -0
- package/elements/oj-date-picker/OjDatePicker.js +8 -0
- package/elements/oj-date-picker/OjDatePicker.js.map +1 -0
- package/elements/oj-date-picker/OjDatePicker.ts +12 -0
- package/elements/oj-date-picker/OjDatePickerBase.js +104 -0
- package/elements/oj-date-picker/OjDatePickerBase.js.map +1 -0
- package/elements/oj-date-picker/OjDatePickerBase.ts +536 -0
- package/elements/oj-date-picker/index.js +17 -0
- package/elements/oj-date-picker/index.js.map +1 -0
- package/elements/oj-date-picker/index.ts +27 -0
- package/elements/oj-date-time-picker/OjDateTimePicker.js +8 -0
- package/elements/oj-date-time-picker/OjDateTimePicker.js.map +1 -0
- package/elements/oj-date-time-picker/OjDateTimePicker.ts +32 -0
- package/elements/oj-date-time-picker/OjDateTimePickerBase.js +107 -0
- package/elements/oj-date-time-picker/OjDateTimePickerBase.js.map +1 -0
- package/elements/oj-date-time-picker/OjDateTimePickerBase.ts +567 -0
- package/elements/oj-date-time-picker/index.js +17 -0
- package/elements/oj-date-time-picker/index.js.map +1 -0
- package/elements/oj-date-time-picker/index.ts +27 -0
- package/elements/oj-diagram/OjDiagram.js +8 -0
- package/elements/oj-diagram/OjDiagram.js.map +1 -0
- package/elements/oj-diagram/OjDiagram.ts +12 -0
- package/elements/oj-diagram/OjDiagramBase.js +128 -0
- package/elements/oj-diagram/OjDiagramBase.js.map +1 -0
- package/elements/oj-diagram/OjDiagramBase.ts +740 -0
- package/elements/oj-diagram/index.js +17 -0
- package/elements/oj-diagram/index.js.map +1 -0
- package/elements/oj-diagram/index.ts +27 -0
- package/elements/oj-dialog/OjDialog.js +13 -0
- package/elements/oj-dialog/OjDialog.js.map +1 -0
- package/elements/oj-dialog/OjDialog.ts +21 -0
- package/elements/oj-dialog/OjDialogBase.js +32 -0
- package/elements/oj-dialog/OjDialogBase.js.map +1 -0
- package/elements/oj-dialog/OjDialogBase.ts +144 -0
- package/elements/oj-dialog/index.js +17 -0
- package/elements/oj-dialog/index.js.map +1 -0
- package/elements/oj-dialog/index.ts +27 -0
- package/elements/oj-file-picker/OjFilePicker.js +36 -0
- package/elements/oj-file-picker/OjFilePicker.js.map +1 -0
- package/elements/oj-file-picker/OjFilePicker.ts +49 -0
- package/elements/oj-file-picker/OjFilePickerBase.js +29 -0
- package/elements/oj-file-picker/OjFilePickerBase.js.map +1 -0
- package/elements/oj-file-picker/OjFilePickerBase.ts +75 -0
- package/elements/oj-file-picker/index.js +17 -0
- package/elements/oj-file-picker/index.js.map +1 -0
- package/elements/oj-file-picker/index.ts +27 -0
- package/elements/oj-film-strip/OjFilmStrip.js +8 -0
- package/elements/oj-film-strip/OjFilmStrip.js.map +1 -0
- package/elements/oj-film-strip/OjFilmStrip.ts +12 -0
- package/elements/oj-film-strip/OjFilmStripBase.js +32 -0
- package/elements/oj-film-strip/OjFilmStripBase.js.map +1 -0
- package/elements/oj-film-strip/OjFilmStripBase.ts +118 -0
- package/elements/oj-film-strip/index.js +17 -0
- package/elements/oj-film-strip/index.js.map +1 -0
- package/elements/oj-film-strip/index.ts +27 -0
- package/elements/oj-gantt/OjGantt.js +8 -0
- package/elements/oj-gantt/OjGantt.js.map +1 -0
- package/elements/oj-gantt/OjGantt.ts +12 -0
- package/elements/oj-gantt/OjGanttBase.js +98 -0
- package/elements/oj-gantt/OjGanttBase.js.map +1 -0
- package/elements/oj-gantt/OjGanttBase.ts +996 -0
- package/elements/oj-gantt/index.js +17 -0
- package/elements/oj-gantt/index.js.map +1 -0
- package/elements/oj-gantt/index.ts +27 -0
- package/elements/oj-indexer/OjIndexer.js +8 -0
- package/elements/oj-indexer/OjIndexer.js.map +1 -0
- package/elements/oj-indexer/OjIndexer.ts +12 -0
- package/elements/oj-indexer/OjIndexerBase.js +14 -0
- package/elements/oj-indexer/OjIndexerBase.js.map +1 -0
- package/elements/oj-indexer/OjIndexerBase.ts +62 -0
- package/elements/oj-indexer/index.js +17 -0
- package/elements/oj-indexer/index.js.map +1 -0
- package/elements/oj-indexer/index.ts +27 -0
- package/elements/oj-input-date/OjInputDate.js +10 -0
- package/elements/oj-input-date/OjInputDate.js.map +1 -0
- package/elements/oj-input-date/OjInputDate.ts +14 -0
- package/elements/oj-input-date/OjInputDateBase.js +107 -0
- package/elements/oj-input-date/OjInputDateBase.js.map +1 -0
- package/elements/oj-input-date/OjInputDateBase.ts +545 -0
- package/elements/oj-input-date/index.js +17 -0
- package/elements/oj-input-date/index.js.map +1 -0
- package/elements/oj-input-date/index.ts +27 -0
- package/elements/oj-input-date-time/OjInputDateTime.js +10 -0
- package/elements/oj-input-date-time/OjInputDateTime.js.map +1 -0
- package/elements/oj-input-date-time/OjInputDateTime.ts +14 -0
- package/elements/oj-input-date-time/OjInputDateTimeBase.js +110 -0
- package/elements/oj-input-date-time/OjInputDateTimeBase.js.map +1 -0
- package/elements/oj-input-date-time/OjInputDateTimeBase.ts +576 -0
- package/elements/oj-input-date-time/index.js +17 -0
- package/elements/oj-input-date-time/index.js.map +1 -0
- package/elements/oj-input-date-time/index.ts +27 -0
- package/elements/oj-input-number/OjInputNumber.js +10 -0
- package/elements/oj-input-number/OjInputNumber.js.map +1 -0
- package/elements/oj-input-number/OjInputNumber.ts +14 -0
- package/elements/oj-input-number/OjInputNumberBase.js +98 -0
- package/elements/oj-input-number/OjInputNumberBase.js.map +1 -0
- package/elements/oj-input-number/OjInputNumberBase.ts +406 -0
- package/elements/oj-input-number/index.js +17 -0
- package/elements/oj-input-number/index.js.map +1 -0
- package/elements/oj-input-number/index.ts +27 -0
- package/elements/oj-input-password/OjInputPassword.js +10 -0
- package/elements/oj-input-password/OjInputPassword.js.map +1 -0
- package/elements/oj-input-password/OjInputPassword.ts +14 -0
- package/elements/oj-input-password/OjInputPasswordBase.js +83 -0
- package/elements/oj-input-password/OjInputPasswordBase.js.map +1 -0
- package/elements/oj-input-password/OjInputPasswordBase.ts +323 -0
- package/elements/oj-input-password/index.js +17 -0
- package/elements/oj-input-password/index.js.map +1 -0
- package/elements/oj-input-password/index.ts +27 -0
- package/elements/oj-input-search/OjInputSearch.js +41 -0
- package/elements/oj-input-search/OjInputSearch.js.map +1 -0
- package/elements/oj-input-search/OjInputSearch.ts +64 -0
- package/elements/oj-input-search/OjInputSearchBase.js +26 -0
- package/elements/oj-input-search/OjInputSearchBase.js.map +1 -0
- package/elements/oj-input-search/OjInputSearchBase.ts +66 -0
- package/elements/oj-input-search/index.js +17 -0
- package/elements/oj-input-search/index.js.map +1 -0
- package/elements/oj-input-search/index.ts +27 -0
- package/elements/oj-input-text/OjInputText.js +10 -0
- package/elements/oj-input-text/OjInputText.js.map +1 -0
- package/elements/oj-input-text/OjInputText.ts +15 -0
- package/elements/oj-input-text/OjInputTextBase.js +95 -0
- package/elements/oj-input-text/OjInputTextBase.js.map +1 -0
- package/elements/oj-input-text/OjInputTextBase.ts +361 -0
- package/elements/oj-input-text/index.js +17 -0
- package/elements/oj-input-text/index.js.map +1 -0
- package/elements/oj-input-text/index.ts +27 -0
- package/elements/oj-input-time/OjInputTime.js +10 -0
- package/elements/oj-input-time/OjInputTime.js.map +1 -0
- package/elements/oj-input-time/OjInputTime.ts +14 -0
- package/elements/oj-input-time/OjInputTimeBase.js +101 -0
- package/elements/oj-input-time/OjInputTimeBase.js.map +1 -0
- package/elements/oj-input-time/OjInputTimeBase.ts +477 -0
- package/elements/oj-input-time/index.js +17 -0
- package/elements/oj-input-time/index.js.map +1 -0
- package/elements/oj-input-time/index.ts +27 -0
- package/elements/oj-label/OjLabel.js +8 -0
- package/elements/oj-label/OjLabel.js.map +1 -0
- package/elements/oj-label/OjLabel.ts +12 -0
- package/elements/oj-label/OjLabelBase.js +23 -0
- package/elements/oj-label/OjLabelBase.js.map +1 -0
- package/elements/oj-label/OjLabelBase.ts +79 -0
- package/elements/oj-label/index.js +17 -0
- package/elements/oj-label/index.js.map +1 -0
- package/elements/oj-label/index.ts +27 -0
- package/elements/oj-led-gauge/OjLedGauge.js +8 -0
- package/elements/oj-led-gauge/OjLedGauge.js.map +1 -0
- package/elements/oj-led-gauge/OjLedGauge.ts +12 -0
- package/elements/oj-led-gauge/OjLedGaugeBase.js +62 -0
- package/elements/oj-led-gauge/OjLedGaugeBase.js.map +1 -0
- package/elements/oj-led-gauge/OjLedGaugeBase.ts +302 -0
- package/elements/oj-led-gauge/index.js +17 -0
- package/elements/oj-led-gauge/index.js.map +1 -0
- package/elements/oj-led-gauge/index.ts +27 -0
- package/elements/oj-legend/OjLegend.js +8 -0
- package/elements/oj-legend/OjLegend.js.map +1 -0
- package/elements/oj-legend/OjLegend.ts +12 -0
- package/elements/oj-legend/OjLegendBase.js +74 -0
- package/elements/oj-legend/OjLegendBase.js.map +1 -0
- package/elements/oj-legend/OjLegendBase.ts +324 -0
- package/elements/oj-legend/index.js +17 -0
- package/elements/oj-legend/index.js.map +1 -0
- package/elements/oj-legend/index.ts +27 -0
- package/elements/oj-list-view/OjListView.js +25 -0
- package/elements/oj-list-view/OjListView.js.map +1 -0
- package/elements/oj-list-view/OjListView.ts +36 -0
- package/elements/oj-list-view/OjListViewBase.js +71 -0
- package/elements/oj-list-view/OjListViewBase.js.map +1 -0
- package/elements/oj-list-view/OjListViewBase.ts +355 -0
- package/elements/oj-list-view/index.js +17 -0
- package/elements/oj-list-view/index.js.map +1 -0
- package/elements/oj-list-view/index.ts +27 -0
- package/elements/oj-masonry-layout/OjMasonryLayout.js +8 -0
- package/elements/oj-masonry-layout/OjMasonryLayout.js.map +1 -0
- package/elements/oj-masonry-layout/OjMasonryLayout.ts +12 -0
- package/elements/oj-masonry-layout/OjMasonryLayoutBase.js +14 -0
- package/elements/oj-masonry-layout/OjMasonryLayoutBase.js.map +1 -0
- package/elements/oj-masonry-layout/OjMasonryLayoutBase.ts +46 -0
- package/elements/oj-masonry-layout/index.js +17 -0
- package/elements/oj-masonry-layout/index.js.map +1 -0
- package/elements/oj-masonry-layout/index.ts +27 -0
- package/elements/oj-menu/OjMenu.js +28 -0
- package/elements/oj-menu/OjMenu.js.map +1 -0
- package/elements/oj-menu/OjMenu.ts +42 -0
- package/elements/oj-menu/OjMenuBase.js +17 -0
- package/elements/oj-menu/OjMenuBase.js.map +1 -0
- package/elements/oj-menu/OjMenuBase.ts +121 -0
- package/elements/oj-menu/index.js +17 -0
- package/elements/oj-menu/index.js.map +1 -0
- package/elements/oj-menu/index.ts +27 -0
- package/elements/oj-menu-button/OjMenuButton.js +14 -0
- package/elements/oj-menu-button/OjMenuButton.js.map +1 -0
- package/elements/oj-menu-button/OjMenuButton.ts +20 -0
- package/elements/oj-menu-button/OjMenuButtonBase.js +20 -0
- package/elements/oj-menu-button/OjMenuButtonBase.js.map +1 -0
- package/elements/oj-menu-button/OjMenuButtonBase.ts +48 -0
- package/elements/oj-menu-button/index.js +17 -0
- package/elements/oj-menu-button/index.js.map +1 -0
- package/elements/oj-menu-button/index.ts +27 -0
- package/elements/oj-message/OjMessage.js +13 -0
- package/elements/oj-message/OjMessage.js.map +1 -0
- package/elements/oj-message/OjMessage.ts +19 -0
- package/elements/oj-message/OjMessageBase.js +17 -0
- package/elements/oj-message/OjMessageBase.js.map +1 -0
- package/elements/oj-message/OjMessageBase.ts +113 -0
- package/elements/oj-message/index.js +17 -0
- package/elements/oj-message/index.js.map +1 -0
- package/elements/oj-message/index.ts +27 -0
- package/elements/oj-n-box/OjNBox.js +8 -0
- package/elements/oj-n-box/OjNBox.js.map +1 -0
- package/elements/oj-n-box/OjNBox.ts +12 -0
- package/elements/oj-n-box/OjNBoxBase.js +116 -0
- package/elements/oj-n-box/OjNBoxBase.js.map +1 -0
- package/elements/oj-n-box/OjNBoxBase.ts +880 -0
- package/elements/oj-n-box/index.js +17 -0
- package/elements/oj-n-box/index.js.map +1 -0
- package/elements/oj-n-box/index.ts +27 -0
- package/elements/oj-navigation-list/OjNavigationList.js +186 -0
- package/elements/oj-navigation-list/OjNavigationList.js.map +1 -0
- package/elements/oj-navigation-list/OjNavigationList.ts +250 -0
- package/elements/oj-navigation-list/OjNavigationListBase.js +50 -0
- package/elements/oj-navigation-list/OjNavigationListBase.js.map +1 -0
- package/elements/oj-navigation-list/OjNavigationListBase.ts +164 -0
- package/elements/oj-navigation-list/index.js +17 -0
- package/elements/oj-navigation-list/index.js.map +1 -0
- package/elements/oj-navigation-list/index.ts +27 -0
- package/elements/oj-paging-control/OjPagingControl.js +13 -0
- package/elements/oj-paging-control/OjPagingControl.js.map +1 -0
- package/elements/oj-paging-control/OjPagingControl.ts +26 -0
- package/elements/oj-paging-control/OjPagingControlBase.js +29 -0
- package/elements/oj-paging-control/OjPagingControlBase.js.map +1 -0
- package/elements/oj-paging-control/OjPagingControlBase.ts +235 -0
- package/elements/oj-paging-control/index.js +17 -0
- package/elements/oj-paging-control/index.js.map +1 -0
- package/elements/oj-paging-control/index.ts +27 -0
- package/elements/oj-picto-chart/OjPictoChart.js +8 -0
- package/elements/oj-picto-chart/OjPictoChart.js.map +1 -0
- package/elements/oj-picto-chart/OjPictoChart.ts +12 -0
- package/elements/oj-picto-chart/OjPictoChartBase.js +86 -0
- package/elements/oj-picto-chart/OjPictoChartBase.js.map +1 -0
- package/elements/oj-picto-chart/OjPictoChartBase.ts +394 -0
- package/elements/oj-picto-chart/index.js +17 -0
- package/elements/oj-picto-chart/index.js.map +1 -0
- package/elements/oj-picto-chart/index.ts +27 -0
- package/elements/oj-popup/OjPopup.js +8 -0
- package/elements/oj-popup/OjPopup.js.map +1 -0
- package/elements/oj-popup/OjPopup.ts +11 -0
- package/elements/oj-popup/OjPopupBase.js +29 -0
- package/elements/oj-popup/OjPopupBase.js.map +1 -0
- package/elements/oj-popup/OjPopupBase.ts +155 -0
- package/elements/oj-popup/index.js +17 -0
- package/elements/oj-popup/index.js.map +1 -0
- package/elements/oj-popup/index.ts +27 -0
- package/elements/oj-progress/OjProgress.js +8 -0
- package/elements/oj-progress/OjProgress.js.map +1 -0
- package/elements/oj-progress/OjProgress.ts +12 -0
- package/elements/oj-progress/OjProgressBase.js +23 -0
- package/elements/oj-progress/OjProgressBase.js.map +1 -0
- package/elements/oj-progress/OjProgressBase.ts +65 -0
- package/elements/oj-progress/index.js +17 -0
- package/elements/oj-progress/index.js.map +1 -0
- package/elements/oj-progress/index.ts +27 -0
- package/elements/oj-progress-list/OjProgressList.js +8 -0
- package/elements/oj-progress-list/OjProgressList.js.map +1 -0
- package/elements/oj-progress-list/OjProgressList.ts +12 -0
- package/elements/oj-progress-list/OjProgressListBase.js +11 -0
- package/elements/oj-progress-list/OjProgressListBase.js.map +1 -0
- package/elements/oj-progress-list/OjProgressListBase.ts +21 -0
- package/elements/oj-progress-list/index.js +17 -0
- package/elements/oj-progress-list/index.js.map +1 -0
- package/elements/oj-progress-list/index.ts +27 -0
- package/elements/oj-radioset/OjRadioset.js +32 -0
- package/elements/oj-radioset/OjRadioset.js.map +1 -0
- package/elements/oj-radioset/OjRadioset.ts +63 -0
- package/elements/oj-radioset/OjRadiosetBase.js +68 -0
- package/elements/oj-radioset/OjRadiosetBase.js.map +1 -0
- package/elements/oj-radioset/OjRadiosetBase.ts +262 -0
- package/elements/oj-radioset/index.js +17 -0
- package/elements/oj-radioset/index.js.map +1 -0
- package/elements/oj-radioset/index.ts +27 -0
- package/elements/oj-rating-gauge/OjRatingGauge.js +8 -0
- package/elements/oj-rating-gauge/OjRatingGauge.js.map +1 -0
- package/elements/oj-rating-gauge/OjRatingGauge.ts +12 -0
- package/elements/oj-rating-gauge/OjRatingGaugeBase.js +80 -0
- package/elements/oj-rating-gauge/OjRatingGaugeBase.js.map +1 -0
- package/elements/oj-rating-gauge/OjRatingGaugeBase.ts +424 -0
- package/elements/oj-rating-gauge/index.js +17 -0
- package/elements/oj-rating-gauge/index.js.map +1 -0
- package/elements/oj-rating-gauge/index.ts +27 -0
- package/elements/oj-refresher/OjRefresher.js +8 -0
- package/elements/oj-refresher/OjRefresher.js.map +1 -0
- package/elements/oj-refresher/OjRefresher.ts +12 -0
- package/elements/oj-refresher/OjRefresherBase.js +20 -0
- package/elements/oj-refresher/OjRefresherBase.js.map +1 -0
- package/elements/oj-refresher/OjRefresherBase.ts +64 -0
- package/elements/oj-refresher/index.js +17 -0
- package/elements/oj-refresher/index.js.map +1 -0
- package/elements/oj-refresher/index.ts +27 -0
- package/elements/oj-row-expander/OjRowExpander.js +8 -0
- package/elements/oj-row-expander/OjRowExpander.js.map +1 -0
- package/elements/oj-row-expander/OjRowExpander.ts +12 -0
- package/elements/oj-row-expander/OjRowExpanderBase.js +20 -0
- package/elements/oj-row-expander/OjRowExpanderBase.js.map +1 -0
- package/elements/oj-row-expander/OjRowExpanderBase.ts +76 -0
- package/elements/oj-row-expander/index.js +17 -0
- package/elements/oj-row-expander/index.js.map +1 -0
- package/elements/oj-row-expander/index.ts +27 -0
- package/elements/oj-select-many/OjSelectMany.js +51 -0
- package/elements/oj-select-many/OjSelectMany.js.map +1 -0
- package/elements/oj-select-many/OjSelectMany.ts +80 -0
- package/elements/oj-select-many/OjSelectManyBase.js +89 -0
- package/elements/oj-select-many/OjSelectManyBase.js.map +1 -0
- package/elements/oj-select-many/OjSelectManyBase.ts +387 -0
- package/elements/oj-select-many/index.js +17 -0
- package/elements/oj-select-many/index.js.map +1 -0
- package/elements/oj-select-many/index.ts +27 -0
- package/elements/oj-select-one/OjSelectOne.js +45 -0
- package/elements/oj-select-one/OjSelectOne.js.map +1 -0
- package/elements/oj-select-one/OjSelectOne.ts +70 -0
- package/elements/oj-select-one/OjSelectOneBase.js +89 -0
- package/elements/oj-select-one/OjSelectOneBase.js.map +1 -0
- package/elements/oj-select-one/OjSelectOneBase.ts +387 -0
- package/elements/oj-select-one/index.js +17 -0
- package/elements/oj-select-one/index.js.map +1 -0
- package/elements/oj-select-one/index.ts +27 -0
- package/elements/oj-select-single/OjSelectSingle.js +35 -0
- package/elements/oj-select-single/OjSelectSingle.js.map +1 -0
- package/elements/oj-select-single/OjSelectSingle.ts +51 -0
- package/elements/oj-select-single/OjSelectSingleBase.js +77 -0
- package/elements/oj-select-single/OjSelectSingleBase.js.map +1 -0
- package/elements/oj-select-single/OjSelectSingleBase.ts +303 -0
- package/elements/oj-select-single/index.js +17 -0
- package/elements/oj-select-single/index.js.map +1 -0
- package/elements/oj-select-single/index.ts +27 -0
- package/elements/oj-selector/OjSelector.js +13 -0
- package/elements/oj-selector/OjSelector.js.map +1 -0
- package/elements/oj-selector/OjSelector.ts +20 -0
- package/elements/oj-selector/OjSelectorBase.js +26 -0
- package/elements/oj-selector/OjSelectorBase.js.map +1 -0
- package/elements/oj-selector/OjSelectorBase.ts +66 -0
- package/elements/oj-selector/index.js +17 -0
- package/elements/oj-selector/index.js.map +1 -0
- package/elements/oj-selector/index.ts +27 -0
- package/elements/oj-slider/OjSlider.js +15 -0
- package/elements/oj-slider/OjSlider.js.map +1 -0
- package/elements/oj-slider/OjSlider.ts +25 -0
- package/elements/oj-slider/OjSliderBase.js +71 -0
- package/elements/oj-slider/OjSliderBase.js.map +1 -0
- package/elements/oj-slider/OjSliderBase.ts +259 -0
- package/elements/oj-slider/index.js +17 -0
- package/elements/oj-slider/index.js.map +1 -0
- package/elements/oj-slider/index.ts +27 -0
- package/elements/oj-spark-chart/OjSparkChart.js +8 -0
- package/elements/oj-spark-chart/OjSparkChart.js.map +1 -0
- package/elements/oj-spark-chart/OjSparkChart.ts +12 -0
- package/elements/oj-spark-chart/OjSparkChartBase.js +95 -0
- package/elements/oj-spark-chart/OjSparkChartBase.js.map +1 -0
- package/elements/oj-spark-chart/OjSparkChartBase.ts +431 -0
- package/elements/oj-spark-chart/index.js +17 -0
- package/elements/oj-spark-chart/index.js.map +1 -0
- package/elements/oj-spark-chart/index.ts +27 -0
- package/elements/oj-status-meter-gauge/OjStatusMeterGauge.js +8 -0
- package/elements/oj-status-meter-gauge/OjStatusMeterGauge.js.map +1 -0
- package/elements/oj-status-meter-gauge/OjStatusMeterGauge.ts +12 -0
- package/elements/oj-status-meter-gauge/OjStatusMeterGaugeBase.js +107 -0
- package/elements/oj-status-meter-gauge/OjStatusMeterGaugeBase.js.map +1 -0
- package/elements/oj-status-meter-gauge/OjStatusMeterGaugeBase.ts +491 -0
- package/elements/oj-status-meter-gauge/index.js +17 -0
- package/elements/oj-status-meter-gauge/index.js.map +1 -0
- package/elements/oj-status-meter-gauge/index.ts +27 -0
- package/elements/oj-stream-list/OjStreamList.js +70 -0
- package/elements/oj-stream-list/OjStreamList.js.map +1 -0
- package/elements/oj-stream-list/OjStreamList.ts +79 -0
- package/elements/oj-stream-list/OjStreamListBase.js +29 -0
- package/elements/oj-stream-list/OjStreamListBase.js.map +1 -0
- package/elements/oj-stream-list/OjStreamListBase.ts +109 -0
- package/elements/oj-stream-list/index.js +17 -0
- package/elements/oj-stream-list/index.js.map +1 -0
- package/elements/oj-stream-list/index.ts +27 -0
- package/elements/oj-sunburst/OjSunburst.js +8 -0
- package/elements/oj-sunburst/OjSunburst.js.map +1 -0
- package/elements/oj-sunburst/OjSunburst.ts +12 -0
- package/elements/oj-sunburst/OjSunburstBase.js +104 -0
- package/elements/oj-sunburst/OjSunburstBase.js.map +1 -0
- package/elements/oj-sunburst/OjSunburstBase.ts +512 -0
- package/elements/oj-sunburst/index.js +17 -0
- package/elements/oj-sunburst/index.js.map +1 -0
- package/elements/oj-sunburst/index.ts +27 -0
- package/elements/oj-swipe-actions/OjSwipeActions.js +19 -0
- package/elements/oj-swipe-actions/OjSwipeActions.js.map +1 -0
- package/elements/oj-swipe-actions/OjSwipeActions.ts +30 -0
- package/elements/oj-swipe-actions/OjSwipeActionsBase.js +11 -0
- package/elements/oj-swipe-actions/OjSwipeActionsBase.js.map +1 -0
- package/elements/oj-swipe-actions/OjSwipeActionsBase.ts +37 -0
- package/elements/oj-swipe-actions/index.js +17 -0
- package/elements/oj-swipe-actions/index.js.map +1 -0
- package/elements/oj-swipe-actions/index.ts +27 -0
- package/elements/oj-switch/OjSwitch.js +16 -0
- package/elements/oj-switch/OjSwitch.js.map +1 -0
- package/elements/oj-switch/OjSwitch.ts +26 -0
- package/elements/oj-switch/OjSwitchBase.js +56 -0
- package/elements/oj-switch/OjSwitchBase.js.map +1 -0
- package/elements/oj-switch/OjSwitchBase.ts +192 -0
- package/elements/oj-switch/index.js +17 -0
- package/elements/oj-switch/index.js.map +1 -0
- package/elements/oj-switch/index.ts +27 -0
- package/elements/oj-tab-bar/OjTabBar.js +8 -0
- package/elements/oj-tab-bar/OjTabBar.js.map +1 -0
- package/elements/oj-tab-bar/OjTabBar.ts +12 -0
- package/elements/oj-tab-bar/OjTabBarBase.js +50 -0
- package/elements/oj-tab-bar/OjTabBarBase.js.map +1 -0
- package/elements/oj-tab-bar/OjTabBarBase.ts +200 -0
- package/elements/oj-tab-bar/index.js +17 -0
- package/elements/oj-tab-bar/index.js.map +1 -0
- package/elements/oj-tab-bar/index.ts +27 -0
- package/elements/oj-table/OjTable.js +33 -0
- package/elements/oj-table/OjTable.js.map +1 -0
- package/elements/oj-table/OjTable.ts +52 -0
- package/elements/oj-table/OjTableBase.js +98 -0
- package/elements/oj-table/OjTableBase.js.map +1 -0
- package/elements/oj-table/OjTableBase.ts +702 -0
- package/elements/oj-table/index.js +17 -0
- package/elements/oj-table/index.js.map +1 -0
- package/elements/oj-table/index.ts +27 -0
- package/elements/oj-tag-cloud/OjTagCloud.js +8 -0
- package/elements/oj-tag-cloud/OjTagCloud.js.map +1 -0
- package/elements/oj-tag-cloud/OjTagCloud.ts +12 -0
- package/elements/oj-tag-cloud/OjTagCloudBase.js +68 -0
- package/elements/oj-tag-cloud/OjTagCloudBase.js.map +1 -0
- package/elements/oj-tag-cloud/OjTagCloudBase.ts +318 -0
- package/elements/oj-tag-cloud/index.js +17 -0
- package/elements/oj-tag-cloud/index.js.map +1 -0
- package/elements/oj-tag-cloud/index.ts +27 -0
- package/elements/oj-text-area/OjTextArea.js +10 -0
- package/elements/oj-text-area/OjTextArea.js.map +1 -0
- package/elements/oj-text-area/OjTextArea.ts +14 -0
- package/elements/oj-text-area/OjTextAreaBase.js +95 -0
- package/elements/oj-text-area/OjTextAreaBase.js.map +1 -0
- package/elements/oj-text-area/OjTextAreaBase.ts +365 -0
- package/elements/oj-text-area/index.js +17 -0
- package/elements/oj-text-area/index.js.map +1 -0
- package/elements/oj-text-area/index.ts +27 -0
- package/elements/oj-thematic-map/OjThematicMap.js +8 -0
- package/elements/oj-thematic-map/OjThematicMap.js.map +1 -0
- package/elements/oj-thematic-map/OjThematicMap.ts +12 -0
- package/elements/oj-thematic-map/OjThematicMapBase.js +119 -0
- package/elements/oj-thematic-map/OjThematicMapBase.js.map +1 -0
- package/elements/oj-thematic-map/OjThematicMapBase.ts +777 -0
- package/elements/oj-thematic-map/index.js +17 -0
- package/elements/oj-thematic-map/index.js.map +1 -0
- package/elements/oj-thematic-map/index.ts +27 -0
- package/elements/oj-time-axis/OjTimeAxis.js +8 -0
- package/elements/oj-time-axis/OjTimeAxis.js.map +1 -0
- package/elements/oj-time-axis/OjTimeAxis.ts +12 -0
- package/elements/oj-time-axis/OjTimeAxisBase.js +26 -0
- package/elements/oj-time-axis/OjTimeAxisBase.js.map +1 -0
- package/elements/oj-time-axis/OjTimeAxisBase.ts +176 -0
- package/elements/oj-time-axis/index.js +17 -0
- package/elements/oj-time-axis/index.js.map +1 -0
- package/elements/oj-time-axis/index.ts +27 -0
- package/elements/oj-timeline/OjTimeline.js +8 -0
- package/elements/oj-timeline/OjTimeline.js.map +1 -0
- package/elements/oj-timeline/OjTimeline.ts +12 -0
- package/elements/oj-timeline/OjTimelineBase.js +71 -0
- package/elements/oj-timeline/OjTimelineBase.js.map +1 -0
- package/elements/oj-timeline/OjTimelineBase.ts +715 -0
- package/elements/oj-timeline/index.js +17 -0
- package/elements/oj-timeline/index.js.map +1 -0
- package/elements/oj-timeline/index.ts +27 -0
- package/elements/oj-train/OjTrain.js +8 -0
- package/elements/oj-train/OjTrain.js.map +1 -0
- package/elements/oj-train/OjTrain.ts +12 -0
- package/elements/oj-train/OjTrainBase.js +20 -0
- package/elements/oj-train/OjTrainBase.js.map +1 -0
- package/elements/oj-train/OjTrainBase.ts +72 -0
- package/elements/oj-train/index.js +17 -0
- package/elements/oj-train/index.js.map +1 -0
- package/elements/oj-train/index.ts +27 -0
- package/elements/oj-tree-view/OjTreeView.js +80 -0
- package/elements/oj-tree-view/OjTreeView.js.map +1 -0
- package/elements/oj-tree-view/OjTreeView.ts +117 -0
- package/elements/oj-tree-view/OjTreeViewBase.js +35 -0
- package/elements/oj-tree-view/OjTreeViewBase.js.map +1 -0
- package/elements/oj-tree-view/OjTreeViewBase.ts +131 -0
- package/elements/oj-tree-view/index.js +17 -0
- package/elements/oj-tree-view/index.js.map +1 -0
- package/elements/oj-tree-view/index.ts +27 -0
- package/elements/oj-treemap/OjTreemap.js +8 -0
- package/elements/oj-treemap/OjTreemap.js.map +1 -0
- package/elements/oj-treemap/OjTreemap.ts +12 -0
- package/elements/oj-treemap/OjTreemapBase.js +110 -0
- package/elements/oj-treemap/OjTreemapBase.js.map +1 -0
- package/elements/oj-treemap/OjTreemapBase.ts +594 -0
- package/elements/oj-treemap/index.js +17 -0
- package/elements/oj-treemap/index.js.map +1 -0
- package/elements/oj-treemap/index.ts +27 -0
- package/elements/oj-waterfall-layout/OjWaterfallLayout.js +8 -0
- package/elements/oj-waterfall-layout/OjWaterfallLayout.js.map +1 -0
- package/elements/oj-waterfall-layout/OjWaterfallLayout.ts +12 -0
- package/elements/oj-waterfall-layout/OjWaterfallLayoutBase.js +23 -0
- package/elements/oj-waterfall-layout/OjWaterfallLayoutBase.js.map +1 -0
- package/elements/oj-waterfall-layout/OjWaterfallLayoutBase.ts +87 -0
- package/elements/oj-waterfall-layout/index.js +17 -0
- package/elements/oj-waterfall-layout/index.js.map +1 -0
- package/elements/oj-waterfall-layout/index.ts +27 -0
- package/index.js +164 -0
- package/index.js.map +1 -0
- package/index.ts +440 -0
- package/lib/Expectation.js +189 -0
- package/lib/Expectation.js.map +1 -0
- package/lib/Expectation.ts +272 -0
- package/lib/OjFetch.js +83 -0
- package/lib/OjFetch.js.map +1 -0
- package/lib/OjFetch.ts +158 -0
- package/lib/ScreenshotManager.js +113 -0
- package/lib/ScreenshotManager.js.map +1 -0
- package/lib/ScreenshotManager.ts +195 -0
- package/lib/driver-manager.js +89 -0
- package/lib/driver-manager.js.map +1 -0
- package/lib/driver-manager.ts +330 -0
- package/lib/driver-override.js +120 -0
- package/lib/driver-override.js.map +1 -0
- package/lib/driver-override.ts +255 -0
- package/lib/input-utils.js +24 -0
- package/lib/input-utils.js.map +1 -0
- package/lib/input-utils.ts +50 -0
- package/lib/slot-proxy.js +25 -0
- package/lib/slot-proxy.js.map +1 -0
- package/lib/slot-proxy.ts +61 -0
- package/lib/stale-element.js +29 -0
- package/lib/stale-element.js.map +1 -0
- package/lib/stale-element.ts +44 -0
- package/package.json +19 -0
- package/tsconfig.json +10 -0
|
@@ -0,0 +1,674 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Browser,
|
|
3
|
+
By,
|
|
4
|
+
Capabilities,
|
|
5
|
+
Capability,
|
|
6
|
+
Condition,
|
|
7
|
+
error,
|
|
8
|
+
ILocation,
|
|
9
|
+
IRectangle,
|
|
10
|
+
ISize,
|
|
11
|
+
Locator,
|
|
12
|
+
WebElement,
|
|
13
|
+
WebElementPromise
|
|
14
|
+
} from "selenium-webdriver";
|
|
15
|
+
import ojwd, { DriverLike, ScreenshotManager as sm } from "../";
|
|
16
|
+
import { requeryElement } from "../lib/stale-element";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The base WebElement class from which all cusom WebElements should extend.
|
|
20
|
+
* This class can also be used (instantiated) directly if no component-specific
|
|
21
|
+
* WebElement exists for a custom component.
|
|
22
|
+
* All WebElement commands which call remote operations on the browser are
|
|
23
|
+
* overidden to first:
|
|
24
|
+
* <ul>
|
|
25
|
+
* <li>
|
|
26
|
+
* Capture screenshots prior to command execution. This aids in debugging if
|
|
27
|
+
* the command should fail.
|
|
28
|
+
* </li>
|
|
29
|
+
* <li>
|
|
30
|
+
* Wait for the page-level BusyContext to clear. This ensures any asynchronous
|
|
31
|
+
* activity in the application is complete before the test continues. Note
|
|
32
|
+
* that commands which interact with the DOM (such as click, sendKeys, etc)
|
|
33
|
+
* will also wait for the element to be present and have a size in the DOM
|
|
34
|
+
* (whenReady), while other "read" methods (getAttribute, isEnabled, etc) only
|
|
35
|
+
* wait for the BusyContext to clear (whenBusyContextReady).
|
|
36
|
+
* </li>
|
|
37
|
+
* <li>
|
|
38
|
+
* Trap StaleElementException and retry. This automatic trapping and retrying
|
|
39
|
+
* for StaleElementExceptions allow tests to be more resilient against UI
|
|
40
|
+
* activities which may move/recreate DOM nodes, typically resulting in failed
|
|
41
|
+
* old references from WebElements to DOM nodes. If a StaleElementException is
|
|
42
|
+
* encountered for any remote command, OjWebElement will requery the DOM node
|
|
43
|
+
* and try the command again. <i>This is implemented for all remote commands
|
|
44
|
+
* except <code>getTagName</code> because, interally, WebDriver uses that
|
|
45
|
+
* command in its <code>until.stalenessOf</code> test condition.</i>
|
|
46
|
+
* </li>
|
|
47
|
+
* </ul>
|
|
48
|
+
*/
|
|
49
|
+
export class OjWebElement extends WebElement {
|
|
50
|
+
/**
|
|
51
|
+
* The ElementLocators object, used when trapping for Stale Element exceptions
|
|
52
|
+
*/
|
|
53
|
+
private _locators: ElementLocators;
|
|
54
|
+
/**
|
|
55
|
+
* Used by whenReady to avoid whenBusyContextReady being repeatedly called
|
|
56
|
+
*/
|
|
57
|
+
private _skipBusyContext: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Cached browser name
|
|
60
|
+
*/
|
|
61
|
+
private static _BROWSER_NAME: string;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Constructor. Pass an instance of WebDriver's WebElement that
|
|
65
|
+
* represents the DOM node on which we"ll perform operations.
|
|
66
|
+
* @param el The basic WebElement with which this WebElement will
|
|
67
|
+
* work.
|
|
68
|
+
*/
|
|
69
|
+
constructor(el: WebElement, locators: ElementLocators) {
|
|
70
|
+
super(el.getDriver(), el.getId());
|
|
71
|
+
this._locators = locators;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @inheritdoc
|
|
76
|
+
*/
|
|
77
|
+
public async clear(): Promise<void> {
|
|
78
|
+
//get the active screenshotManager instance to take and save screenshot before action
|
|
79
|
+
const screenshotManager = sm.get();
|
|
80
|
+
await screenshotManager.takeAndSaveScreenShot(
|
|
81
|
+
this.getDriver(),
|
|
82
|
+
"before_clear"
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
await this.whenReady();
|
|
86
|
+
await OjWebElement.trapStaleElement<void, [void]>(
|
|
87
|
+
this,
|
|
88
|
+
super.clear,
|
|
89
|
+
undefined
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
// JET-41358
|
|
93
|
+
// When input components embedded within oj-table, they can lose focus
|
|
94
|
+
// after clear().
|
|
95
|
+
return this.getDriver().executeScript("arguments[0].focus()", this);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* @inheritdoc
|
|
99
|
+
*/
|
|
100
|
+
public async click(): Promise<void> {
|
|
101
|
+
//get the active screenshotManager instance to take and save screenshot before action
|
|
102
|
+
const screenshotManager = sm.get();
|
|
103
|
+
await screenshotManager.takeAndSaveScreenShot(
|
|
104
|
+
this.getDriver(),
|
|
105
|
+
"before_click"
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
await this.whenReady();
|
|
109
|
+
await this.getDriver().executeScript('arguments[0].focus()', this);
|
|
110
|
+
return OjWebElement.trapStaleElement<void, [void]>(
|
|
111
|
+
this,
|
|
112
|
+
super.click,
|
|
113
|
+
undefined
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* @inheritdoc
|
|
118
|
+
*/
|
|
119
|
+
public async getAttribute(attributeName: string): Promise<string> {
|
|
120
|
+
await this.whenBusyContextReady();
|
|
121
|
+
return OjWebElement.trapStaleElement<string, [string]>(
|
|
122
|
+
this,
|
|
123
|
+
super.getAttribute,
|
|
124
|
+
attributeName
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* @inheritdoc
|
|
129
|
+
*/
|
|
130
|
+
public async getCssValue(cssStyleProperty: string): Promise<string> {
|
|
131
|
+
//get the active screenshotManager instance to take and save screenshot before action
|
|
132
|
+
const screenshotManager = sm.get();
|
|
133
|
+
await screenshotManager.takeAndSaveScreenShot(
|
|
134
|
+
this.getDriver(),
|
|
135
|
+
"before_getCssValue"
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
await this.whenBusyContextReady();
|
|
139
|
+
return OjWebElement.trapStaleElement<string, [string]>(
|
|
140
|
+
this,
|
|
141
|
+
super.getCssValue,
|
|
142
|
+
cssStyleProperty
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* @inheritdoc
|
|
147
|
+
*/
|
|
148
|
+
public async getLocation(): Promise<ILocation> {
|
|
149
|
+
//get the active screenshotManager instance to take and save screenshot before action
|
|
150
|
+
const screenshotManager = sm.get();
|
|
151
|
+
await screenshotManager.takeAndSaveScreenShot(
|
|
152
|
+
this.getDriver(),
|
|
153
|
+
"before_getLocation"
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
await this.whenBusyContextReady();
|
|
157
|
+
return OjWebElement.trapStaleElement<ILocation, [void]>(
|
|
158
|
+
this,
|
|
159
|
+
super.getLocation,
|
|
160
|
+
undefined
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* @inheritdoc
|
|
165
|
+
*/
|
|
166
|
+
public async getRect(): Promise<IRectangle> {
|
|
167
|
+
//get the active screenshotManager instance to take and save screenshot before action
|
|
168
|
+
const screenshotManager = sm.get();
|
|
169
|
+
await screenshotManager.takeAndSaveScreenShot(
|
|
170
|
+
this.getDriver(),
|
|
171
|
+
"before_getRect"
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
await this.whenBusyContextReady();
|
|
175
|
+
return OjWebElement.trapStaleElement<IRectangle, [void]>(
|
|
176
|
+
this,
|
|
177
|
+
super.getRect,
|
|
178
|
+
undefined
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* @inheritdoc
|
|
183
|
+
*/
|
|
184
|
+
public async getSize(): Promise<ISize> {
|
|
185
|
+
//get the active screenshotManager instance to take and save screenshot before action
|
|
186
|
+
const screenshotManager = sm.get();
|
|
187
|
+
await screenshotManager.takeAndSaveScreenShot(
|
|
188
|
+
this.getDriver(),
|
|
189
|
+
"before_getSize"
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
await this.whenBusyContextReady();
|
|
193
|
+
return OjWebElement.trapStaleElement<ISize, [void]>(
|
|
194
|
+
this,
|
|
195
|
+
super.getSize,
|
|
196
|
+
undefined
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* @inheritdoc
|
|
201
|
+
*/
|
|
202
|
+
public async getText(): Promise<string> {
|
|
203
|
+
//get the active screenshotManager instance to take and save screenshot before action
|
|
204
|
+
const screenshotManager = sm.get();
|
|
205
|
+
await screenshotManager.takeAndSaveScreenShot(
|
|
206
|
+
this.getDriver(),
|
|
207
|
+
"before_getText"
|
|
208
|
+
);
|
|
209
|
+
|
|
210
|
+
await this.whenBusyContextReady();
|
|
211
|
+
return OjWebElement.trapStaleElement<string, [void]>(
|
|
212
|
+
this,
|
|
213
|
+
super.getText,
|
|
214
|
+
undefined
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* @inheritdoc
|
|
219
|
+
*/
|
|
220
|
+
public async isDisplayed(): Promise<boolean> {
|
|
221
|
+
await this.whenBusyContextReady();
|
|
222
|
+
return OjWebElement.trapStaleElement<boolean, [void]>(
|
|
223
|
+
this,
|
|
224
|
+
super.isDisplayed,
|
|
225
|
+
undefined
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* @inheritdoc
|
|
230
|
+
*/
|
|
231
|
+
public async isEnabled(): Promise<boolean> {
|
|
232
|
+
//get the active screenshotManager instance to take and save screenshot before action
|
|
233
|
+
const screenshotManager = sm.get();
|
|
234
|
+
await screenshotManager.takeAndSaveScreenShot(
|
|
235
|
+
this.getDriver(),
|
|
236
|
+
"before_isEnabled"
|
|
237
|
+
);
|
|
238
|
+
|
|
239
|
+
await this.whenBusyContextReady();
|
|
240
|
+
// See if component has a "disabled" property to test if it's disabled.
|
|
241
|
+
let disabled = await this.getProperty<boolean>("disabled");
|
|
242
|
+
if (typeof disabled === "boolean") {
|
|
243
|
+
return !disabled;
|
|
244
|
+
}
|
|
245
|
+
// If component doesn't have a "disabled" property, defer to WebDriver to
|
|
246
|
+
// test if the element is disabled.
|
|
247
|
+
return await OjWebElement.trapStaleElement<boolean, [void]>(
|
|
248
|
+
this,
|
|
249
|
+
super.isEnabled,
|
|
250
|
+
undefined
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* @inheritdoc
|
|
255
|
+
*/
|
|
256
|
+
public async isSelected(): Promise<boolean> {
|
|
257
|
+
//get the active screenshotManager instance to take and save screenshot before action
|
|
258
|
+
const screenshotManager = sm.get();
|
|
259
|
+
await screenshotManager.takeAndSaveScreenShot(
|
|
260
|
+
this.getDriver(),
|
|
261
|
+
"before_isSelected"
|
|
262
|
+
);
|
|
263
|
+
|
|
264
|
+
await this.whenBusyContextReady();
|
|
265
|
+
return OjWebElement.trapStaleElement<boolean, [void]>(
|
|
266
|
+
this,
|
|
267
|
+
super.isSelected,
|
|
268
|
+
undefined
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* @inheritdoc
|
|
273
|
+
*/
|
|
274
|
+
public async sendKeys(
|
|
275
|
+
...varArgs: Array<string | number | Promise<string | number>>
|
|
276
|
+
): Promise<void> {
|
|
277
|
+
//get the active screenshotManager instance to take and save screenshot before action
|
|
278
|
+
const screenshotManager = sm.get();
|
|
279
|
+
await screenshotManager.takeAndSaveScreenShot(
|
|
280
|
+
this.getDriver(),
|
|
281
|
+
"before_sendKeys"
|
|
282
|
+
);
|
|
283
|
+
|
|
284
|
+
await this.whenReady();
|
|
285
|
+
return OjWebElement.trapStaleElement<
|
|
286
|
+
void,
|
|
287
|
+
Array<string | number | Promise<string | number>>
|
|
288
|
+
>(this, super.sendKeys, ...varArgs);
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* @inheritdoc
|
|
292
|
+
*/
|
|
293
|
+
public async submit(): Promise<void> {
|
|
294
|
+
//get the active screenshotManager instance to take and save screenshot before action
|
|
295
|
+
const screenshotManager = sm.get();
|
|
296
|
+
await screenshotManager.takeAndSaveScreenShot(
|
|
297
|
+
this.getDriver(),
|
|
298
|
+
"before_submit"
|
|
299
|
+
);
|
|
300
|
+
|
|
301
|
+
await this.whenReady();
|
|
302
|
+
return OjWebElement.trapStaleElement<void, [void]>(
|
|
303
|
+
this,
|
|
304
|
+
super.submit,
|
|
305
|
+
undefined
|
|
306
|
+
);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* @inheritdoc
|
|
311
|
+
*/
|
|
312
|
+
public findElement(locator: Locator): WebElementPromise {
|
|
313
|
+
// Note that this function isn't declared async because the superclass
|
|
314
|
+
// signature returns a WebElementPromise, but TS requires that all
|
|
315
|
+
// async functions return Promise<T>.
|
|
316
|
+
// Instead, we get the Promise from calling the superclass method, then return
|
|
317
|
+
// that in a new WebElementPromise
|
|
318
|
+
const p = this.whenReady().then(() =>
|
|
319
|
+
OjWebElement.trapStaleElement<WebElement, [Locator]>(
|
|
320
|
+
this,
|
|
321
|
+
super.findElement,
|
|
322
|
+
locator
|
|
323
|
+
)
|
|
324
|
+
);
|
|
325
|
+
return new WebElementPromise(this.getDriver(), p);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* @inheritdoc
|
|
330
|
+
*/
|
|
331
|
+
public async findElements(locator: Locator): Promise<WebElement[]> {
|
|
332
|
+
//get the active screenshotManager instance to take and save screenshot before action
|
|
333
|
+
const screenshotManager = sm.get();
|
|
334
|
+
await screenshotManager.takeAndSaveScreenShot(
|
|
335
|
+
this.getDriver(),
|
|
336
|
+
"before_findElements"
|
|
337
|
+
);
|
|
338
|
+
|
|
339
|
+
await this.whenReady();
|
|
340
|
+
const el = OjWebElement.trapStaleElement<WebElement[], [Locator]>(
|
|
341
|
+
this,
|
|
342
|
+
super.findElements,
|
|
343
|
+
locator
|
|
344
|
+
);
|
|
345
|
+
return el;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* @inheritdoc
|
|
350
|
+
*/
|
|
351
|
+
public async takeScreenshot(optScroll?: boolean): Promise<string> {
|
|
352
|
+
const ss = OjWebElement.trapStaleElement<string, [boolean]>(
|
|
353
|
+
this,
|
|
354
|
+
super.takeScreenshot,
|
|
355
|
+
optScroll
|
|
356
|
+
);
|
|
357
|
+
return ss;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Returns a Promise that is resolved when the element is ready
|
|
362
|
+
* for interaction--it is visible, has a size, and the app's
|
|
363
|
+
* busy context is ready. Operations on the DOM which rely on its physical
|
|
364
|
+
* location and size to be in a "ready" state should use this command, such as
|
|
365
|
+
* clicking, sending keys, locating child elements, and so on.
|
|
366
|
+
* @return A Promise that's resolved when all conditions
|
|
367
|
+
* are met.
|
|
368
|
+
*/
|
|
369
|
+
public async whenReady(): Promise<void> {
|
|
370
|
+
const driver = this.getDriver();
|
|
371
|
+
const timeout = 15000;
|
|
372
|
+
const tag = `<${this._locators.tagName}>`;
|
|
373
|
+
|
|
374
|
+
await this.whenBusyContextReady();
|
|
375
|
+
// Tell whenBusyContextReady to skip its check for these methods, which will
|
|
376
|
+
// continually be called by driver.wait()
|
|
377
|
+
this._skipBusyContext = true;
|
|
378
|
+
try {
|
|
379
|
+
await driver.wait(
|
|
380
|
+
() => this.isDisplayed(),
|
|
381
|
+
timeout,
|
|
382
|
+
`waiting for ${tag} to be visible`
|
|
383
|
+
);
|
|
384
|
+
return driver.wait<void>(
|
|
385
|
+
async () => {
|
|
386
|
+
const size = await this.getSize();
|
|
387
|
+
return size.height > 0 && size.width > 0;
|
|
388
|
+
},
|
|
389
|
+
timeout,
|
|
390
|
+
`waiting for ${tag} to have non-zero size`
|
|
391
|
+
);
|
|
392
|
+
} finally {
|
|
393
|
+
this._skipBusyContext = false;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Returns a Promise that is resolved when the application's busy
|
|
399
|
+
* state reports ready. This method checks only that the application's busy
|
|
400
|
+
* context is ready, and not that the DOM element is actually displayed or has
|
|
401
|
+
* a physical size, such as is the case with {@link #whenReady}. Operations
|
|
402
|
+
* which are read-only in nature should call this method prior to execution.
|
|
403
|
+
* @return A Promise which is resolved when the
|
|
404
|
+
* page's busy state is ready.
|
|
405
|
+
*/
|
|
406
|
+
public async whenBusyContextReady(): Promise<void> {
|
|
407
|
+
if (this._skipBusyContext) {
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
const remoteScript = `
|
|
411
|
+
var done=arguments[0];
|
|
412
|
+
if (typeof require === 'function') {
|
|
413
|
+
try {
|
|
414
|
+
const Context = require('ojs/ojcontext');
|
|
415
|
+
Context.getPageContext().getBusyContext().whenReady()
|
|
416
|
+
.then(function() { done() })
|
|
417
|
+
.catch(function(ex) { done(ex.message) });
|
|
418
|
+
} catch (ex) {
|
|
419
|
+
done('ojs/ojcontext not found');
|
|
420
|
+
}
|
|
421
|
+
} else {
|
|
422
|
+
done('RequireJS not found');
|
|
423
|
+
}
|
|
424
|
+
`;
|
|
425
|
+
const ret = await this.getDriver()
|
|
426
|
+
.executeAsyncScript(remoteScript)
|
|
427
|
+
.catch(async (ex) => {
|
|
428
|
+
const openStates = await this.getDriver().executeScript(`
|
|
429
|
+
let Context = require('ojs/ojcontext');
|
|
430
|
+
let desc = Context.getPageContext().getBusyContext().getBusyStates()
|
|
431
|
+
.map((state) => state.description);
|
|
432
|
+
return JSON.stringify(desc);
|
|
433
|
+
`).catch(ex => ex.message);
|
|
434
|
+
console.warn(`${ex.message}\nopen busy states: ${openStates}`);
|
|
435
|
+
throw Error(`BusyContext.whenReady() timed out: ${ex.message}`);
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
if (ret) {
|
|
439
|
+
// If error during require call, log warning
|
|
440
|
+
console.warn(`Cannot wait on BusyContext: ${ret}`);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Get a named property value from this component. This function
|
|
446
|
+
* will wait for the application's busy context to complete before
|
|
447
|
+
* attempting to get the property value.
|
|
448
|
+
* @param {string} propertyName The name of the property
|
|
449
|
+
* @return A Promise that yields a value for the named property.
|
|
450
|
+
*/
|
|
451
|
+
public async getProperty<T = string>(propertyName: string): Promise<T> {
|
|
452
|
+
await this.whenBusyContextReady();
|
|
453
|
+
return OjWebElement.trapStaleElement<T, [string]>(
|
|
454
|
+
this,
|
|
455
|
+
this._getProperty,
|
|
456
|
+
propertyName
|
|
457
|
+
);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* Set a property value on the remote element. This function first waits for
|
|
462
|
+
* the BusyContext to clear before setting the property, then after setting,
|
|
463
|
+
* waits again to ensure that no additional busy states were created due to
|
|
464
|
+
* the property setting.
|
|
465
|
+
* @param {string} propertyName The property name to set
|
|
466
|
+
* @param {T} value The value to set for the property
|
|
467
|
+
* @return A Promise which resolves when the remote
|
|
468
|
+
* property has been set to the value. Any value returned from
|
|
469
|
+
* the call to set the remote property is returned in the Promise.
|
|
470
|
+
*/
|
|
471
|
+
protected async setProperty<T = string>(
|
|
472
|
+
propertyName: string,
|
|
473
|
+
value: T
|
|
474
|
+
): Promise<void> {
|
|
475
|
+
await this.whenReady();
|
|
476
|
+
await OjWebElement.trapStaleElement<void, [string, T]>(
|
|
477
|
+
this,
|
|
478
|
+
this._setProperty,
|
|
479
|
+
propertyName,
|
|
480
|
+
value
|
|
481
|
+
);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Create a wait condition that is satisfied when the element's
|
|
486
|
+
* DOM has a non-zero size.
|
|
487
|
+
* @return The Condition to be used with driver.wait()
|
|
488
|
+
* that's satisfied when the element's DOM has a non-zero size.
|
|
489
|
+
*/
|
|
490
|
+
protected hasSize(): Condition<Promise<boolean>> {
|
|
491
|
+
return new Condition<Promise<boolean>>(
|
|
492
|
+
`<${this._locators.tagName}> has a non-zero size`,
|
|
493
|
+
async driver => {
|
|
494
|
+
const rect = await this.getSize();
|
|
495
|
+
return rect.height > 0 && rect.width > 0;
|
|
496
|
+
}
|
|
497
|
+
);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Create a wait condition that is satisfid when the element is
|
|
502
|
+
* visible. The condition is satisfied when the element is displayed,
|
|
503
|
+
* as reported by {@link #isDisplayed}, and is scrolled into view.
|
|
504
|
+
* This is method is deprecated. Use {@link WebElement.isDisplayed} instead to
|
|
505
|
+
* test the display of the element, and scroll it into view if necessary.
|
|
506
|
+
* @deprecated
|
|
507
|
+
*/
|
|
508
|
+
protected hasVisibility(): Condition<Promise<boolean>> {
|
|
509
|
+
return new Condition<Promise<boolean>>(
|
|
510
|
+
`<${this._locators.tagName}> is displayed and scrolled into view`,
|
|
511
|
+
async driver => {
|
|
512
|
+
const displayed = await this.isDisplayed();
|
|
513
|
+
if (displayed) {
|
|
514
|
+
// Scroll the DOM into view and return true to fulfill
|
|
515
|
+
// the Condition
|
|
516
|
+
await driver.executeScript("arguments[0].scrollIntoView()", this);
|
|
517
|
+
return true;
|
|
518
|
+
}
|
|
519
|
+
return displayed;
|
|
520
|
+
}
|
|
521
|
+
);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Private accessor to get the component property value. This is for
|
|
526
|
+
* trapStaleElement to call and handle the stale element exception when calling
|
|
527
|
+
* getProperty.
|
|
528
|
+
* @param propertyName The name of the property
|
|
529
|
+
* @return A Promise that yields a value for the named property.
|
|
530
|
+
* @typeparam T The value type of the property
|
|
531
|
+
*/
|
|
532
|
+
private async _getProperty<T>(propertyName: string): Promise<T> {
|
|
533
|
+
if (!OjWebElement._BROWSER_NAME) {
|
|
534
|
+
const caps = await this.getDriver().getCapabilities();
|
|
535
|
+
OjWebElement._BROWSER_NAME = caps.get(Capability.BROWSER_NAME);
|
|
536
|
+
}
|
|
537
|
+
if (OjWebElement._BROWSER_NAME === Browser.FIREFOX) {
|
|
538
|
+
return this._getPropertyFirefox<T>(propertyName);
|
|
539
|
+
}
|
|
540
|
+
return this.getDriver().executeAsyncScript<T>(
|
|
541
|
+
`let el = arguments[0], prop = arguments[1], done = arguments[2];
|
|
542
|
+
require(['ojs/ojcustomelement-utils'], function(utils) {
|
|
543
|
+
done(utils.CustomElementUtils.getElementProperty(el, prop));
|
|
544
|
+
}, done);
|
|
545
|
+
`,
|
|
546
|
+
this,
|
|
547
|
+
propertyName
|
|
548
|
+
);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* Get a DOM property. This method is for Firefox to work around the Geckodriver
|
|
553
|
+
* issue identified by JET-42751.
|
|
554
|
+
* @param propertyName The property name
|
|
555
|
+
* @return The property value
|
|
556
|
+
*/
|
|
557
|
+
private async _getPropertyFirefox<T>(propertyName: string): Promise<T> {
|
|
558
|
+
const driver = this.getDriver();
|
|
559
|
+
// Ensure ojs/ojcustomelement-utils module is loaded, then do a synchronous
|
|
560
|
+
// executeScript call to retrieve the property
|
|
561
|
+
await driver.executeAsyncScript(`require(['ojs/ojcustomelement-utils'], arguments[0])`);
|
|
562
|
+
return driver.executeScript<T>(
|
|
563
|
+
`let el = arguments[0], prop = arguments[1];
|
|
564
|
+
return require('ojs/ojcustomelement-utils').CustomElementUtils.getElementProperty(el, prop);`,
|
|
565
|
+
this,
|
|
566
|
+
propertyName
|
|
567
|
+
);
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* Private mutator to set the component property value. This is trapStaleElement
|
|
572
|
+
* to call and handle the stale element exception when calling setProperty.
|
|
573
|
+
* @param propertyName The name of the property
|
|
574
|
+
* @param value The value to set for the property
|
|
575
|
+
* @typeparam T The value type of the property
|
|
576
|
+
*/
|
|
577
|
+
private async _setProperty<T>(propertyName: string, value: T): Promise<void> {
|
|
578
|
+
await this.getDriver().executeScript(
|
|
579
|
+
// Call setProperty on the component if it exists, otherwise, set the
|
|
580
|
+
// property value directly.
|
|
581
|
+
`return arguments[0].setProperty ?
|
|
582
|
+
arguments[0].setProperty(arguments[1], arguments[2])
|
|
583
|
+
: arguments[0][arguments[1]] = arguments[2]`,
|
|
584
|
+
this,
|
|
585
|
+
propertyName,
|
|
586
|
+
value
|
|
587
|
+
);
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* Trap commands against OjWebElement and look for stale element exceptions. If
|
|
592
|
+
* found, re-query the element and try the command again.
|
|
593
|
+
* @private
|
|
594
|
+
* @typeparam T The type of value returned from the command.
|
|
595
|
+
* @typeparam P The type of parameters passed to the command.
|
|
596
|
+
* @param el The OjWebElement instance on which the command will work
|
|
597
|
+
* @param cmd The command on the OjWebElement to execute
|
|
598
|
+
* @param cmdParams Any parameters to pass to the command
|
|
599
|
+
* @return A Promise with the results of the command, if any.
|
|
600
|
+
*/
|
|
601
|
+
private static async trapStaleElement<T, P extends unknown[]>(
|
|
602
|
+
el: OjWebElement,
|
|
603
|
+
cmd: (...p: P) => Promise<T>,
|
|
604
|
+
...cmdParams: P
|
|
605
|
+
): Promise<T> {
|
|
606
|
+
let result: T;
|
|
607
|
+
try {
|
|
608
|
+
result = await cmd.apply(el, cmdParams);
|
|
609
|
+
} catch (ex) {
|
|
610
|
+
// Only requery if elLocator exists on the WebElement. This will be present
|
|
611
|
+
// most of the time, except for when an element is returned through
|
|
612
|
+
// driver.wait(until.elementLocated). That method doesn't allow access to
|
|
613
|
+
// the original locator.
|
|
614
|
+
if (ex instanceof error.StaleElementReferenceError && el._locators.elLocator) {
|
|
615
|
+
console.warn(`Trapped stale element calling '${cmd.name}' on ${el._locators.elLocator}`);
|
|
616
|
+
const newEl = await requeryElement(el);
|
|
617
|
+
result = await cmd.apply(newEl, cmdParams);
|
|
618
|
+
} else {
|
|
619
|
+
throw ex;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
return result;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* An interface defining the element location criteria for the original OjWebElement.
|
|
628
|
+
* The properties are used by OjWebElement when trapping for stale element references
|
|
629
|
+
* so that it can requery the original DOM element.
|
|
630
|
+
* These values are typically set by the OjWebElement creation process and not
|
|
631
|
+
* called directly by other WebElement or test code.
|
|
632
|
+
* @private
|
|
633
|
+
*/
|
|
634
|
+
export interface ElementLocators {
|
|
635
|
+
/**
|
|
636
|
+
* The original locator for the WebElement. This can be an absolute locator
|
|
637
|
+
* (used by WebDriver.findElement) or relative to the parent element (used by
|
|
638
|
+
* WebElement.findElement). If absolute, a parentEl should not be specified;
|
|
639
|
+
* if relative, a parentEl must be specified.
|
|
640
|
+
*/
|
|
641
|
+
readonly elLocator: Locator;
|
|
642
|
+
/**
|
|
643
|
+
* The parent OjWebElement from which the elLocator was queried. This should
|
|
644
|
+
* only be specified if the elLocator was used by WebElement.findElement.
|
|
645
|
+
*/
|
|
646
|
+
readonly parentEl?: OjWebElement;
|
|
647
|
+
/**
|
|
648
|
+
* The original index within the array of elements returned from findElements.
|
|
649
|
+
* This value should only be set when the element was queried using findElements.
|
|
650
|
+
* All other rules regarding setting elLocator and parentEl still apply when
|
|
651
|
+
* setting this index.
|
|
652
|
+
*/
|
|
653
|
+
readonly elementsIndex?: number;
|
|
654
|
+
/**
|
|
655
|
+
* The original tag name of the element. This is used to compare the original
|
|
656
|
+
* tag name against the tag name of the re-queried element.
|
|
657
|
+
*/
|
|
658
|
+
readonly tagName: string;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* Create an instance of [[OjWebElement]]. This function will first wait for
|
|
663
|
+
* the element to appear in the DOM before trying to locate it.
|
|
664
|
+
* @param driver A WebDriver/WebElement instance used to locate the component
|
|
665
|
+
* element.
|
|
666
|
+
* @param by The By locator with which to find the element
|
|
667
|
+
*/
|
|
668
|
+
export async function ojWebElement(
|
|
669
|
+
driver: DriverLike,
|
|
670
|
+
by: By
|
|
671
|
+
): Promise<OjWebElement> {
|
|
672
|
+
const el = await ojwd.waitAndFindElement(driver, by);
|
|
673
|
+
return el as OjWebElement;
|
|
674
|
+
}
|