Skip to content

Commit

Permalink
WEBUI-1352: update lts2021 from node js branch
Browse files Browse the repository at this point in the history
  • Loading branch information
swarnadipa-dev authored and rahuljain-dev committed Jan 11, 2024
1 parent 62f3b03 commit 9640b8e
Show file tree
Hide file tree
Showing 119 changed files with 4,387 additions and 2,855 deletions.
73 changes: 40 additions & 33 deletions .github/workflows/a11y.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
PACKAGES_AUTH_USER:
description: 'PACKAGES_AUTH_USER'
required: true
PACKAGES_AUTH_TOKEN:
PACKAGES_AUTH_TOKEN:
description: 'PACKAGES_AUTH_TOKEN'
required: true

Expand All @@ -31,42 +31,49 @@ jobs:
a11y:
runs-on: [self-hosted, master]
steps:
- uses: actions/checkout@v2
with:
ref: ${{ env.BRANCH_NAME }}
- uses: actions/checkout@v2
with:
ref: ${{ env.BRANCH_NAME }}

- run: git config user.name "nuxeo-webui-jx-bot" && git config user.email "webui@hyland.com"
- run: git config user.name "nuxeo-webui-jx-bot" && git config user.email "webui@hyland.com"

- uses: actions/setup-node@v3
with:
registry-url: ${{ env.NPM_REPOSITORY }}
node-version: 14
scope: '@nuxeo'
- uses: actions/setup-node@v3
with:
registry-url: ${{ env.NPM_REPOSITORY }}
node-version: 18
scope: '@nuxeo'

- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- name: Install Web UI
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PACKAGES_TOKEN }}
run: |
npm install
pushd packages/nuxeo-web-ui-ftest
npm install
popd
pushd packages/nuxeo-designer-catalog
npm install
popd
- name: Install google chrome
run: |
wget https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_114.0.5735.90-1_amd64.deb
apt install -y --allow-downgrades ./google-chrome-stable_114.0.5735.90-1_amd64.deb
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'

- name: 'Update settings.xml with server configuration'
run: |
echo '<settings>
<servers>
<server>
<id>maven-internal</id>
<username>${{ secrets.PACKAGES_AUTH_USER }}</username>
<password>${{ secrets.PACKAGES_AUTH_TOKEN }}</password>
</server>
</servers>
</settings>' > ~/.m2/settings.xml
- name: 'Update settings.xml with server configuration'
run: |
echo '<settings>
<servers>
<server>
<id>maven-internal</id>
<username>${{ secrets.PACKAGES_AUTH_USER }}</username>
<password>${{ secrets.PACKAGES_AUTH_TOKEN }}</password>
</server>
</servers>
</settings>' > ~/.m2/settings.xml
- name: Web UI build
run: mvn -B -ntp install
- name: Web UI build
run: mvn -B -ntp install

- name: A11y checks
run: mvn -B -ntp -f plugin/a11y install
- name: A11y checks
run: mvn -B -ntp -f plugin/a11y install
19 changes: 14 additions & 5 deletions .github/workflows/ftest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,13 @@ jobs:
with:
registry-url: ${{ env.NPM_REPOSITORY }}
scope: '@nuxeo'
node-version: 18

- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'

- name: Install google chrome
run: |
wget -q https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_114.0.5735.90-1_amd64.deb
apt install -y --allow-downgrades ./google-chrome-stable_114.0.5735.90-1_amd64.deb
- name: Determine nuxeo-elements branch to link
id: pick_nuxeo_elements_branch
run: |
Expand Down Expand Up @@ -99,6 +95,19 @@ jobs:
popd
popd
- name: add .npmrc
run: |
pushd /tmp/_temp/
ls
rm .npmrc
touch .npmrc
popd
echo '
packages.nuxeo.com/repository/npm-public/:_auth=${NODE_AUTH_TOKEN}
@nuxeo:registry=https://packages.nuxeo.com/repository/npm-public/
always-auth=true
' >> /tmp/_temp/.npmrc
- name: Link elements to Web UI
run: |
npm install --no-package-lock --@nuxeo:registry="${{ env.NPM_REPOSITORY }}" nuxeo-elements/core/${ELEMENTS_CORE}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- uses: actions/setup-node@v3
with:
registry-url: 'https://packages.nuxeo.com/repository/npm-public/'
node-version: 14
node-version: 18
scope: '@nuxeo'

- name: Install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
steps:
- uses: actions/setup-node@v3
with:
node-version: 14
node-version: 18
registry-url: 'https://packages.nuxeo.com/repository/npm-public/'
scope: '@nuxeo'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/promote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- uses: actions/setup-node@v3
with:
node-version: 14
node-version: 18
registry-url: 'https://packages.nuxeo.com/repository/npm-public/'
scope: '@nuxeo'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
with:
registry-url: 'https://packages.nuxeo.com/repository/npm-public/'
scope: '@nuxeo'
node-version: 14
node-version: 18

- name: Install
env:
Expand Down
28 changes: 0 additions & 28 deletions addons/nuxeo-csv/ftest/features/step_definitions/csv-import.js

This file was deleted.

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);
});
Loading

0 comments on commit 9640b8e

Please sign in to comment.