-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WEBUI-1352: update lts2021 from node js branch
- Loading branch information
1 parent
62f3b03
commit 9640b8e
Showing
119 changed files
with
4,387 additions
and
2,855 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
addons/nuxeo-csv/ftest/features/step_definitions/csv-import.js
This file was deleted.
Oops, something went wrong.
106 changes: 62 additions & 44 deletions
106
addons/nuxeo-spreadsheet/ftest/features/step_definitions/spreadsheet.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,84 @@ | ||
import { Then, When } from '@cucumber/cucumber'; | ||
import Spreadsheet from '../../pages/spreadsheet'; | ||
|
||
When('I open the spreadsheet', function() { | ||
const button = this.ui.results.actions.element('nuxeo-spreadsheet-button').click(); | ||
|
||
button.waitForVisible('#dialog'); | ||
|
||
const iframe = button.element('#iframe'); | ||
driver.frame(iframe.value); | ||
|
||
this.spreadsheet = new Spreadsheet(); | ||
When('I open the spreadsheet', async function() { | ||
const result = await this.ui.results; | ||
const browser = await this.ui.browser; | ||
const actions = await result.actions; | ||
const buttonEle = await actions.element('nuxeo-spreadsheet-button'); | ||
await buttonEle.click(); | ||
const dialog = await buttonEle.element('#dialog'); | ||
await dialog.waitForVisible(); | ||
const iframe = await buttonEle.element('#iframe'); | ||
await iframe.waitForExist(); | ||
await browser.switchToFrame(iframe); | ||
this.spreadsheet = await new Spreadsheet(); | ||
}); | ||
|
||
When('I see the spreadsheet dialog', function() { | ||
const button = this.ui.browser.results.actions.element('nuxeo-spreadsheet-button'); | ||
button.waitForVisible('#dialog'); | ||
}); | ||
|
||
Then('I can see the spreadsheet results actions button', function() { | ||
const { results } = this.ui; | ||
|
||
if (results.displayMode !== 'table') { | ||
results.toggleTableView.click(); | ||
Then('I can see the spreadsheet results actions button', async function() { | ||
const currentUI = await this.ui; | ||
const results = await currentUI.results; | ||
if ((await results.displayMode) !== 'table') { | ||
const toggleTableViewBtn = await results.toggleTableView; | ||
await toggleTableViewBtn.click(); | ||
} | ||
|
||
results.actions.waitForVisible('nuxeo-spreadsheet-button'); | ||
const button = await results.actions; | ||
await button.waitForVisible('nuxeo-spreadsheet-button'); | ||
}); | ||
|
||
Then('I can see the {string} spreadsheet column', function(column) { | ||
assert(this.spreadsheet, 'Spreadsheet editor does not exist'); | ||
return this.spreadsheet.headers.includes(column); | ||
Then('I can see the {string} spreadsheet column', async function(column) { | ||
const spreadsheet = await this.spreadsheet; | ||
if (spreadsheet) { | ||
const header = await spreadsheet.headers; | ||
await header.includes(column); | ||
} else { | ||
throw Error('Error: Spreadsheet does not exist!!'); | ||
} | ||
}); | ||
|
||
When('I set the spreadsheet cell {int},{int} to {string}', function(row, col, value) { | ||
const { spreadsheet } = this; | ||
assert(spreadsheet, 'Spreadsheet does not exist'); | ||
|
||
spreadsheet.setData(row, col, value); | ||
When('I set the spreadsheet cell {int},{int} to {string}', async function(row, col, value) { | ||
const spreadsheet = await this.spreadsheet; | ||
if (spreadsheet) { | ||
spreadsheet.setData(row, col, value); | ||
} else { | ||
throw Error('Error: Spreadsheet does not exist!!'); | ||
} | ||
}); | ||
|
||
When('I save the spreadsheet', function() { | ||
const { spreadsheet } = this; | ||
assert(spreadsheet, 'Spreadsheet does not exist'); | ||
|
||
spreadsheet.save(); | ||
|
||
const { console } = spreadsheet; | ||
driver.waitUntil(() => console.getText() === '1 rows saved'); | ||
When('I save the spreadsheet', async function() { | ||
const spreadsheet = await this.spreadsheet; | ||
if (spreadsheet) { | ||
await spreadsheet.save(); | ||
const consoleEle = await spreadsheet.console; | ||
await consoleEle.getText(); | ||
} else { | ||
throw Error('Error: Spreadsheet does not exist!!'); | ||
} | ||
}); | ||
|
||
When('I close the spreadsheet', function() { | ||
const { spreadsheet } = this; | ||
assert(spreadsheet, 'Spreadsheet does not exist'); | ||
|
||
spreadsheet.close(); | ||
driver.frame(); | ||
When('I close the spreadsheet', async function() { | ||
const spreadsheet = await this.spreadsheet; | ||
const browser = await this.ui.browser; | ||
if (spreadsheet) { | ||
await spreadsheet.close(); | ||
await browser.switchToFrame(null); | ||
} else { | ||
throw Error('Error: Spreadsheet does not exist!!'); | ||
} | ||
}); | ||
|
||
Then('I see {string} in the results table cell {int},{int}', function(value, row, col) { | ||
const { results } = this.ui; | ||
results.waitForVisible(); | ||
const tableRow = results.el.elements('nuxeo-data-table-row:not([header])').value[row]; | ||
const tableCell = tableRow.elements('nuxeo-data-table-cell').value[col]; | ||
expect(tableCell.getText()).to.equal(value); | ||
Then('I see {string} in the results table cell {int},{int}', async function(value, row, col) { | ||
const results = await this.ui.results; | ||
await results.waitForVisible(); | ||
const tableRow = await results.el.elements('nuxeo-data-table-row:not([header])'); | ||
const tableRowValue = await tableRow[row]; | ||
const tableCell = await tableRowValue.elements('nuxeo-data-table-cell'); | ||
const tableCol = await tableCell[col]; | ||
const tableColText = await tableCol.getText(); | ||
tableColText.should.be.equal(value); | ||
}); |
Oops, something went wrong.