mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) updates from grist-core
This commit is contained in:
commit
051c6d52fe
21
.github/workflows/main.yml
vendored
21
.github/workflows/main.yml
vendored
@ -98,10 +98,31 @@ jobs:
|
|||||||
- name: Run main tests without minio and redis
|
- name: Run main tests without minio and redis
|
||||||
if: contains(matrix.tests, ':nbrowser-')
|
if: contains(matrix.tests, ':nbrowser-')
|
||||||
run: |
|
run: |
|
||||||
|
mkdir -p $MOCHA_WEBDRIVER_LOGDIR
|
||||||
export GREP_TESTS=$(echo $TESTS | sed "s/.*:nbrowser-\([^:]*\).*/\1/")
|
export GREP_TESTS=$(echo $TESTS | sed "s/.*:nbrowser-\([^:]*\).*/\1/")
|
||||||
MOCHA_WEBDRIVER_SKIP_CLEANUP=1 MOCHA_WEBDRIVER_HEADLESS=1 yarn run test:nbrowser --parallel --jobs 3
|
MOCHA_WEBDRIVER_SKIP_CLEANUP=1 MOCHA_WEBDRIVER_HEADLESS=1 yarn run test:nbrowser --parallel --jobs 3
|
||||||
env:
|
env:
|
||||||
TESTS: ${{ matrix.tests }}
|
TESTS: ${{ matrix.tests }}
|
||||||
|
MOCHA_WEBDRIVER_LOGDIR: ${{ runner.temp }}/test-logs/webdriver
|
||||||
|
TESTDIR: ${{ runner.temp }}/test-logs
|
||||||
|
|
||||||
|
- name: Prepare for saving artifact
|
||||||
|
if: failure()
|
||||||
|
run: |
|
||||||
|
ARTIFACT_NAME=logs-$(echo $TESTS | sed 's/[^-a-zA-Z0-9]/_/g')
|
||||||
|
echo "Artifact name is '$ARTIFACT_NAME'"
|
||||||
|
echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_ENV
|
||||||
|
find $TESTDIR -iname "*.socket" -exec rm {} \;
|
||||||
|
env:
|
||||||
|
TESTS: ${{ matrix.tests }}
|
||||||
|
TESTDIR: ${{ runner.temp }}/test-logs
|
||||||
|
|
||||||
|
- name: Save artifacts on failure
|
||||||
|
if: failure()
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ env.ARTIFACT_NAME }}
|
||||||
|
path: ${{ runner.temp }}/test-logs # only exists for webdriver tests
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# https://github.com/bitnami/bitnami-docker-minio/issues/16
|
# https://github.com/bitnami/bitnami-docker-minio/issues/16
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
const fs = require('fs');
|
||||||
const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
|
const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
|
||||||
const { ProvidePlugin } = require('webpack');
|
const { ProvidePlugin } = require('webpack');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
@ -15,7 +16,11 @@ module.exports = {
|
|||||||
account: "app/client/accountMain",
|
account: "app/client/accountMain",
|
||||||
billing: "app/client/billingMain",
|
billing: "app/client/billingMain",
|
||||||
activation: "app/client/activationMain",
|
activation: "app/client/activationMain",
|
||||||
test: "test/client-harness/client",
|
// Include client test harness if it is present (it won't be in
|
||||||
|
// docker image).
|
||||||
|
...(fs.existsSync("test/client-harness/client.js") ? {
|
||||||
|
test: "test/client-harness/client",
|
||||||
|
} : {}),
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
filename: "[name].bundle.js",
|
filename: "[name].bundle.js",
|
||||||
|
@ -1073,5 +1073,31 @@
|
|||||||
"WebhookPage": {
|
"WebhookPage": {
|
||||||
"Clear Queue": "Warteschlange löschen",
|
"Clear Queue": "Warteschlange löschen",
|
||||||
"Webhook Settings": "Webhaken Einstellungen"
|
"Webhook Settings": "Webhaken Einstellungen"
|
||||||
|
},
|
||||||
|
"FormulaAssistant": {
|
||||||
|
"Ask the bot.": "Fragen Sie den Bot.",
|
||||||
|
"Capabilities": "Fähigkeiten",
|
||||||
|
"Community": "Gemeinschaft",
|
||||||
|
"Data": "Daten",
|
||||||
|
"Formula Cheat Sheet": "Formel-Spickzettel",
|
||||||
|
"Formula Help. ": "Formel-Hilfe. ",
|
||||||
|
"Function List": "Funktionsliste",
|
||||||
|
"Grist's AI Assistance": "Grists KI-Unterstützung",
|
||||||
|
"Grist's AI Formula Assistance. ": "Grists KI-Formelunterstützung. ",
|
||||||
|
"Need help? Our AI assistant can help.": "Brauchen Sie Hilfe? Unser KI-Assistent kann helfen.",
|
||||||
|
"New Chat": "Neuer Chat",
|
||||||
|
"Preview": "Vorschau",
|
||||||
|
"Regenerate": "Regenerieren",
|
||||||
|
"Save": "Speichern",
|
||||||
|
"See our {{helpFunction}} and {{formulaCheat}}, or visit our {{community}} for more help.": "Weitere Informationen finden Sie unter {{helpFunction}} und {{formulaCheat}} oder besuchen Sie unsere {{community}} für weitere Hilfe.",
|
||||||
|
"Tips": "Tipps"
|
||||||
|
},
|
||||||
|
"GridView": {
|
||||||
|
"Click to insert": "Zum Einfügen klicken"
|
||||||
|
},
|
||||||
|
"WelcomeSitePicker": {
|
||||||
|
"Welcome back": "Willkommen zurück",
|
||||||
|
"You can always switch sites using the account menu.": "Sie können jederzeit über das Kontomenü zwischen den Websites wechseln.",
|
||||||
|
"You have access to the following Grist sites.": "Sie haben Zugriff auf die folgenden Grist-Seiten."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1063,5 +1063,31 @@
|
|||||||
"WebhookPage": {
|
"WebhookPage": {
|
||||||
"Clear Queue": "Borrar la cola",
|
"Clear Queue": "Borrar la cola",
|
||||||
"Webhook Settings": "Ajustes del gancho web"
|
"Webhook Settings": "Ajustes del gancho web"
|
||||||
|
},
|
||||||
|
"FormulaAssistant": {
|
||||||
|
"Regenerate": "Regenerar",
|
||||||
|
"Save": "Guardar",
|
||||||
|
"Preview": "Vista previa",
|
||||||
|
"Need help? Our AI assistant can help.": "¿Necesitas ayuda? Nuestro asistente de IA puede ayudarle.",
|
||||||
|
"New Chat": "Nuevo chat",
|
||||||
|
"Ask the bot.": "Pregúntale al bot.",
|
||||||
|
"Capabilities": "Capacidades",
|
||||||
|
"Community": "Comunidad",
|
||||||
|
"Data": "Datos",
|
||||||
|
"Formula Cheat Sheet": "Hoja de trucos de fórmulas",
|
||||||
|
"Formula Help. ": "Ayuda de fórmula. ",
|
||||||
|
"Function List": "Lista de función",
|
||||||
|
"Grist's AI Assistance": "Asistencia de IA de Grist",
|
||||||
|
"Grist's AI Formula Assistance. ": "Asistencia de fórmula de IA de Grist. ",
|
||||||
|
"Tips": "Consejos",
|
||||||
|
"See our {{helpFunction}} and {{formulaCheat}}, or visit our {{community}} for more help.": "Consulte nuestras páginas {{helpFunction}} y {{formulaCheat}}, o visite nuestra página {{community}} para obtener más ayuda."
|
||||||
|
},
|
||||||
|
"GridView": {
|
||||||
|
"Click to insert": "Haga clic para insertar"
|
||||||
|
},
|
||||||
|
"WelcomeSitePicker": {
|
||||||
|
"Welcome back": "Bienvenido de nuevo",
|
||||||
|
"You can always switch sites using the account menu.": "Siempre puedes cambiar de sitio utilizando el menú de la cuenta.",
|
||||||
|
"You have access to the following Grist sites.": "Usted tiene acceso a los siguientes sitios de Grist."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1009,5 +1009,31 @@
|
|||||||
"Clipboard": {
|
"Clipboard": {
|
||||||
"Unavailable Command": "Comando non disponibile",
|
"Unavailable Command": "Comando non disponibile",
|
||||||
"Got it": "Ricevuto"
|
"Got it": "Ricevuto"
|
||||||
|
},
|
||||||
|
"FormulaAssistant": {
|
||||||
|
"Ask the bot.": "Chiedi al bot.",
|
||||||
|
"Capabilities": "Capacità",
|
||||||
|
"Community": "Comunità",
|
||||||
|
"Data": "Dati",
|
||||||
|
"Formula Cheat Sheet": "Azioni tipiche con le formule",
|
||||||
|
"Formula Help. ": "Aiuto con le formule. ",
|
||||||
|
"Function List": "Lista delle funzioni",
|
||||||
|
"Grist's AI Assistance": "Assistenza dalla IA di Grist",
|
||||||
|
"Need help? Our AI assistant can help.": "Bisogno di aiuto? Prova il nostro assistente IA.",
|
||||||
|
"New Chat": "Nuova chat",
|
||||||
|
"Preview": "Anteprima",
|
||||||
|
"Regenerate": "Rigenera",
|
||||||
|
"Save": "Salva",
|
||||||
|
"Tips": "Suggerimenti",
|
||||||
|
"Grist's AI Formula Assistance. ": "Assistenza dalla IA di Grist per le formule. ",
|
||||||
|
"See our {{helpFunction}} and {{formulaCheat}}, or visit our {{community}} for more help.": "Vedi {{helpFunction}} e {{formulaCheat}}, o visita la {{community}} per ulteriore aiuto."
|
||||||
|
},
|
||||||
|
"GridView": {
|
||||||
|
"Click to insert": "Clicca per inserire"
|
||||||
|
},
|
||||||
|
"WelcomeSitePicker": {
|
||||||
|
"Welcome back": "Bentornato",
|
||||||
|
"You can always switch sites using the account menu.": "Puoi sempre cambiare sito usando il menu del tuo profilo.",
|
||||||
|
"You have access to the following Grist sites.": "Hai accesso a questi siti di Grist."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
1038
static/locales/pt.client.json
Normal file
1038
static/locales/pt.client.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -1073,5 +1073,31 @@
|
|||||||
"Clear field": "Limpar campo",
|
"Clear field": "Limpar campo",
|
||||||
"Copy": "Copiar",
|
"Copy": "Copiar",
|
||||||
"Cut": "Cortar"
|
"Cut": "Cortar"
|
||||||
|
},
|
||||||
|
"FormulaAssistant": {
|
||||||
|
"Capabilities": "Capacidades",
|
||||||
|
"Formula Help. ": "Ajuda de Fórmula. ",
|
||||||
|
"Function List": "Lista de funções",
|
||||||
|
"Grist's AI Assistance": "Assistência de IA do Grist",
|
||||||
|
"Grist's AI Formula Assistance. ": "Assistência à Fórmula IA do Grist. ",
|
||||||
|
"Need help? Our AI assistant can help.": "Precisa de ajuda? Nosso assistente de IA pode ajudar.",
|
||||||
|
"New Chat": "Novo chat",
|
||||||
|
"Preview": "Prévisualizar",
|
||||||
|
"Regenerate": "Regenerar",
|
||||||
|
"Save": "Salvar",
|
||||||
|
"Tips": "Dicas",
|
||||||
|
"See our {{helpFunction}} and {{formulaCheat}}, or visit our {{community}} for more help.": "Consulte nossos sites {{helpFunction}} e {{formulaCheat}}, ou visite nosso site {{community}} para obter mais ajuda.",
|
||||||
|
"Ask the bot.": "Pergunte ao bot.",
|
||||||
|
"Data": "Dados",
|
||||||
|
"Formula Cheat Sheet": "Folha de Consulta da Fórmula",
|
||||||
|
"Community": "Comunidade"
|
||||||
|
},
|
||||||
|
"GridView": {
|
||||||
|
"Click to insert": "Clique para inserir"
|
||||||
|
},
|
||||||
|
"WelcomeSitePicker": {
|
||||||
|
"You have access to the following Grist sites.": "Você tem acesso aos seguintes sites do Grist.",
|
||||||
|
"Welcome back": "Bem-vindo de volta",
|
||||||
|
"You can always switch sites using the account menu.": "Você sempre pode alternar entre sites usando o menu da conta."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1009,5 +1009,31 @@
|
|||||||
"WebhookPage": {
|
"WebhookPage": {
|
||||||
"Clear Queue": "Очистить очередь",
|
"Clear Queue": "Очистить очередь",
|
||||||
"Webhook Settings": "Настройки вебхука"
|
"Webhook Settings": "Настройки вебхука"
|
||||||
|
},
|
||||||
|
"FormulaAssistant": {
|
||||||
|
"Ask the bot.": "Спроси у бота.",
|
||||||
|
"Capabilities": "Возможности",
|
||||||
|
"Community": "Сообщество",
|
||||||
|
"Data": "Данные",
|
||||||
|
"Formula Cheat Sheet": "Шпаргалка по формуле",
|
||||||
|
"Formula Help. ": "Справка по формуле. ",
|
||||||
|
"Function List": "Список функций",
|
||||||
|
"Grist's AI Assistance": "Помощь AI Grist'а",
|
||||||
|
"Grist's AI Formula Assistance. ": "Помощник по формуле AI Grist'a. ",
|
||||||
|
"New Chat": "Новый чат",
|
||||||
|
"Preview": "Предпросмотр",
|
||||||
|
"Regenerate": "Регенерировать",
|
||||||
|
"Save": "Сохранить",
|
||||||
|
"See our {{helpFunction}} and {{formulaCheat}}, or visit our {{community}} for more help.": "Посмотрите наш {{helpFunction}} и {{formulaCheat}}, или поситите наше {{community}} для получения дополнительной помощи.",
|
||||||
|
"Tips": "Советы",
|
||||||
|
"Need help? Our AI assistant can help.": "Нужна помощь? Наш AI помощник может помочь."
|
||||||
|
},
|
||||||
|
"GridView": {
|
||||||
|
"Click to insert": "Нажмите для вставки"
|
||||||
|
},
|
||||||
|
"WelcomeSitePicker": {
|
||||||
|
"Welcome back": "С возвращением",
|
||||||
|
"You can always switch sites using the account menu.": "Вы всегда можете переключиться с одного сайта на другой, используя меню учетной записи.",
|
||||||
|
"You have access to the following Grist sites.": "У вас есть доступ к следующим сайтам Grist."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
43
test/fixtures/sites/config/page.js
vendored
43
test/fixtures/sites/config/page.js
vendored
@ -4,28 +4,30 @@
|
|||||||
const urlParams = new URLSearchParams(window.location.search);
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
const ready = urlParams.get('ready') ? JSON.parse(urlParams.get('ready')) : undefined;
|
const ready = urlParams.get('ready') ? JSON.parse(urlParams.get('ready')) : undefined;
|
||||||
|
|
||||||
if (ready && ready.onEditOptions) {
|
function setup() {
|
||||||
ready.onEditOptions = () => {
|
if (ready && ready.onEditOptions) {
|
||||||
document.getElementById('configure').innerHTML = 'called';
|
ready.onEditOptions = () => {
|
||||||
};
|
document.getElementById('configure').innerHTML = 'called';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
grist.ready(ready);
|
||||||
|
|
||||||
|
grist.onOptions(data => {
|
||||||
|
document.getElementById('onOptions').innerHTML = JSON.stringify(data);
|
||||||
|
});
|
||||||
|
|
||||||
|
grist.onRecord((data, mappings) => {
|
||||||
|
document.getElementById('onRecord').innerHTML = JSON.stringify(data);
|
||||||
|
document.getElementById('onRecordMappings').innerHTML = JSON.stringify(mappings);
|
||||||
|
});
|
||||||
|
|
||||||
|
grist.onRecords((data, mappings) => {
|
||||||
|
document.getElementById('onRecords').innerHTML = JSON.stringify(data);
|
||||||
|
document.getElementById('onRecordsMappings').innerHTML = JSON.stringify(mappings);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
grist.ready(ready);
|
|
||||||
|
|
||||||
grist.onOptions(data => {
|
|
||||||
document.getElementById('onOptions').innerHTML = JSON.stringify(data);
|
|
||||||
});
|
|
||||||
|
|
||||||
grist.onRecord((data, mappings) => {
|
|
||||||
document.getElementById('onRecord').innerHTML = JSON.stringify(data);
|
|
||||||
document.getElementById('onRecordMappings').innerHTML = JSON.stringify(mappings);
|
|
||||||
});
|
|
||||||
|
|
||||||
grist.onRecords((data, mappings) => {
|
|
||||||
document.getElementById('onRecords').innerHTML = JSON.stringify(data);
|
|
||||||
document.getElementById('onRecordsMappings').innerHTML = JSON.stringify(mappings);
|
|
||||||
});
|
|
||||||
|
|
||||||
async function run(handler) {
|
async function run(handler) {
|
||||||
try {
|
try {
|
||||||
document.getElementById('output').innerText = 'waiting...';
|
document.getElementById('output').innerText = 'waiting...';
|
||||||
@ -66,6 +68,7 @@ async function configure() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
window.onload = () => {
|
window.onload = () => {
|
||||||
|
setup();
|
||||||
document.getElementById('ready').innerText = 'ready';
|
document.getElementById('ready').innerText = 'ready';
|
||||||
document.getElementById('access').innerHTML = urlParams.get('access');
|
document.getElementById('access').innerHTML = urlParams.get('access');
|
||||||
document.getElementById('readonly').innerHTML = urlParams.get('readonly');
|
document.getElementById('readonly').innerHTML = urlParams.get('readonly');
|
||||||
|
@ -7,7 +7,6 @@ describe('ColumnOps.ntest', function() {
|
|||||||
const cleanup = test.setupTestSuite(this);
|
const cleanup = test.setupTestSuite(this);
|
||||||
|
|
||||||
before(async function() {
|
before(async function() {
|
||||||
this.timeout(Math.max(this.timeout(), 30000)); // Long-running test, unfortunately
|
|
||||||
await gu.supportOldTimeyTestCode();
|
await gu.supportOldTimeyTestCode();
|
||||||
await gu.useFixtureDoc(cleanup, "World.grist", true);
|
await gu.useFixtureDoc(cleanup, "World.grist", true);
|
||||||
await gu.toggleSidePanel('left', 'close');
|
await gu.toggleSidePanel('left', 'close');
|
||||||
|
@ -223,10 +223,10 @@ describe('CustomWidgetsConfig', function () {
|
|||||||
constructor(public frameSelector = 'iframe') {}
|
constructor(public frameSelector = 'iframe') {}
|
||||||
// Wait for a frame.
|
// Wait for a frame.
|
||||||
public async waitForFrame() {
|
public async waitForFrame() {
|
||||||
await driver.wait(() => driver.find(this.frameSelector).isPresent(), 1000);
|
await driver.wait(() => driver.find(this.frameSelector).isPresent(), 3000);
|
||||||
const iframe = driver.find(this.frameSelector);
|
const iframe = driver.find(this.frameSelector);
|
||||||
await driver.switchTo().frame(iframe);
|
await driver.switchTo().frame(iframe);
|
||||||
await driver.wait(async () => (await driver.find('#ready').getText()) === 'ready', 1000);
|
await driver.wait(async () => (await driver.find('#ready').getText()) === 'ready', 3000);
|
||||||
await driver.switchTo().defaultContent();
|
await driver.switchTo().defaultContent();
|
||||||
}
|
}
|
||||||
public async content() {
|
public async content() {
|
||||||
@ -254,7 +254,7 @@ describe('CustomWidgetsConfig', function () {
|
|||||||
}
|
}
|
||||||
// Wait for frame to close.
|
// Wait for frame to close.
|
||||||
public async waitForClose() {
|
public async waitForClose() {
|
||||||
await driver.wait(async () => !(await driver.find(this.frameSelector).isPresent()), 1000);
|
await driver.wait(async () => !(await driver.find(this.frameSelector).isPresent()), 3000);
|
||||||
}
|
}
|
||||||
// Wait for the onOptions event, and return its value.
|
// Wait for the onOptions event, and return its value.
|
||||||
public async onOptions() {
|
public async onOptions() {
|
||||||
@ -262,7 +262,7 @@ describe('CustomWidgetsConfig', function () {
|
|||||||
await driver.switchTo().frame(iframe);
|
await driver.switchTo().frame(iframe);
|
||||||
// Wait for options to get filled, initially this div is empty,
|
// Wait for options to get filled, initially this div is empty,
|
||||||
// as first message it should get at least null as an options.
|
// as first message it should get at least null as an options.
|
||||||
await driver.wait(async () => await driver.find('#onOptions').getText(), 1000);
|
await driver.wait(async () => await driver.find('#onOptions').getText(), 3000);
|
||||||
const text = await driver.find('#onOptions').getText();
|
const text = await driver.find('#onOptions').getText();
|
||||||
await driver.switchTo().defaultContent();
|
await driver.switchTo().defaultContent();
|
||||||
return JSON.parse(text);
|
return JSON.parse(text);
|
||||||
|
@ -116,8 +116,7 @@ describe("Localization", function() {
|
|||||||
// But only uz code is preloaded.
|
// But only uz code is preloaded.
|
||||||
notPresent(uzResponse, "uz-UZ");
|
notPresent(uzResponse, "uz-UZ");
|
||||||
|
|
||||||
// For Portuguese we have only en.
|
notPresent(ptResponse, "pt-PR", "uz", "en-US");
|
||||||
notPresent(ptResponse, "pt", "pt-PR", "uz", "en-US");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("loads correct languages from file system", async function() {
|
it("loads correct languages from file system", async function() {
|
||||||
|
@ -12,9 +12,6 @@ describe('RightPanelSelectBy', function() {
|
|||||||
const doc = await gu.importFixturesDoc('chimpy', 'nasa', 'Horizon', 'Favorite_Films_With_Linked_Ref.grist', false);
|
const doc = await gu.importFixturesDoc('chimpy', 'nasa', 'Horizon', 'Favorite_Films_With_Linked_Ref.grist', false);
|
||||||
await driver.get(`${server.getHost()}/o/nasa/doc/${doc.id}`);
|
await driver.get(`${server.getHost()}/o/nasa/doc/${doc.id}`);
|
||||||
await gu.waitForDocToLoad();
|
await gu.waitForDocToLoad();
|
||||||
|
|
||||||
await gu.toggleSidePanel('right', 'open');
|
|
||||||
await driver.find('.test-config-data').click();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
it('should allow linking section with same table', async function() {
|
it('should allow linking section with same table', async function() {
|
||||||
@ -24,7 +21,7 @@ describe('RightPanelSelectBy', function() {
|
|||||||
await driver.findContentWait('.test-treeview-itemHeader', /All/, 2000).click();
|
await driver.findContentWait('.test-treeview-itemHeader', /All/, 2000).click();
|
||||||
await gu.waitForDocToLoad();
|
await gu.waitForDocToLoad();
|
||||||
|
|
||||||
await openSelectByForSection('PERFORMANCES DETAIL');
|
await gu.openSelectByForSection('PERFORMANCES DETAIL');
|
||||||
|
|
||||||
// the dollar in /...record$/ makes sure we match against the table main node and not a ref
|
// the dollar in /...record$/ makes sure we match against the table main node and not a ref
|
||||||
// columns such as '...record.Film'
|
// columns such as '...record.Film'
|
||||||
@ -52,7 +49,7 @@ describe('RightPanelSelectBy', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should allow to remove link', async function() {
|
it('should allow to remove link', async function() {
|
||||||
await openSelectByForSection('PERFORMANCES DETAIL');
|
await gu.openSelectByForSection('PERFORMANCES DETAIL');
|
||||||
await driver.findContent('.test-select-row', /Select Widget/).click();
|
await driver.findContent('.test-select-row', /Select Widget/).click();
|
||||||
await gu.waitForServer();
|
await gu.waitForServer();
|
||||||
|
|
||||||
@ -67,7 +64,7 @@ describe('RightPanelSelectBy', function() {
|
|||||||
|
|
||||||
|
|
||||||
it('should disallow creating cycles', async function() {
|
it('should disallow creating cycles', async function() {
|
||||||
await openSelectByForSection('PERFORMANCES RECORD');
|
await gu.openSelectByForSection('PERFORMANCES RECORD');
|
||||||
assert.equal(await driver.findContent('.test-select-row', /Performances detail/).isPresent(), false);
|
assert.equal(await driver.findContent('.test-select-row', /Performances detail/).isPresent(), false);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -81,7 +78,7 @@ describe('RightPanelSelectBy', function() {
|
|||||||
await gu.addNewSection(/Chart/, /Films/);
|
await gu.addNewSection(/Chart/, /Films/);
|
||||||
|
|
||||||
// open `SELECT BY`
|
// open `SELECT BY`
|
||||||
await openSelectByForSection('FILMS');
|
await gu.openSelectByForSection('FILMS');
|
||||||
|
|
||||||
// check that there is a chart and we cannot link from it
|
// check that there is a chart and we cannot link from it
|
||||||
assert.equal(await gu.getSection('FILMS CHART').isPresent(), true);
|
assert.equal(await gu.getSection('FILMS CHART').isPresent(), true);
|
||||||
@ -96,7 +93,7 @@ describe('RightPanelSelectBy', function() {
|
|||||||
await gu.getPageItem('Friends').click();
|
await gu.getPageItem('Friends').click();
|
||||||
await gu.waitForServer();
|
await gu.waitForServer();
|
||||||
await gu.addNewSection(/Table/, /Performances/);
|
await gu.addNewSection(/Table/, /Performances/);
|
||||||
await openSelectByForSection('Performances');
|
await gu.openSelectByForSection('Performances');
|
||||||
assert.equal(await driver.findContent('.test-select-row', /FRIENDS.*Favorite Film/).isPresent(), true);
|
assert.equal(await driver.findContent('.test-select-row', /FRIENDS.*Favorite Film/).isPresent(), true);
|
||||||
await driver.findContent('.test-select-row', /FRIENDS.*Favorite Film/).click();
|
await driver.findContent('.test-select-row', /FRIENDS.*Favorite Film/).click();
|
||||||
await gu.waitForServer();
|
await gu.waitForServer();
|
||||||
@ -135,7 +132,7 @@ describe('RightPanelSelectBy', function() {
|
|||||||
await gu.getPageItem('Friends').click();
|
await gu.getPageItem('Friends').click();
|
||||||
await gu.waitForServer();
|
await gu.waitForServer();
|
||||||
await gu.addNewSection(/Card/, /Films/);
|
await gu.addNewSection(/Card/, /Films/);
|
||||||
await openSelectByForSection('Films Card');
|
await gu.openSelectByForSection('Films Card');
|
||||||
assert.equal(await driver.findContent('.test-select-row', /FRIENDS.*Favorite Film/).isPresent(), true);
|
assert.equal(await driver.findContent('.test-select-row', /FRIENDS.*Favorite Film/).isPresent(), true);
|
||||||
await driver.findContent('.test-select-row', /FRIENDS.*Favorite Film/).click();
|
await driver.findContent('.test-select-row', /FRIENDS.*Favorite Film/).click();
|
||||||
await gu.waitForServer();
|
await gu.waitForServer();
|
||||||
@ -194,8 +191,3 @@ describe('RightPanelSelectBy', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export async function openSelectByForSection(section: string) {
|
|
||||||
await gu.getSection(section).click();
|
|
||||||
await driver.find('.test-right-select-by').click();
|
|
||||||
}
|
|
||||||
|
@ -2,7 +2,6 @@ import * as _ from 'lodash';
|
|||||||
import {addToRepl, assert, driver} from 'mocha-webdriver';
|
import {addToRepl, assert, driver} from 'mocha-webdriver';
|
||||||
import * as gu from 'test/nbrowser/gristUtils';
|
import * as gu from 'test/nbrowser/gristUtils';
|
||||||
import {server, setupTestSuite} from 'test/nbrowser/testUtils';
|
import {server, setupTestSuite} from 'test/nbrowser/testUtils';
|
||||||
import {openSelectByForSection} from "./RightPanelSelectBy";
|
|
||||||
|
|
||||||
describe('SelectByRefList', function() {
|
describe('SelectByRefList', function() {
|
||||||
this.timeout(60000);
|
this.timeout(60000);
|
||||||
@ -16,9 +15,6 @@ describe('SelectByRefList', function() {
|
|||||||
'SelectByRefList.grist', false);
|
'SelectByRefList.grist', false);
|
||||||
await driver.get(`${server.getHost()}/o/nasa/doc/${doc.id}`);
|
await driver.get(`${server.getHost()}/o/nasa/doc/${doc.id}`);
|
||||||
await gu.waitForDocToLoad();
|
await gu.waitForDocToLoad();
|
||||||
|
|
||||||
await gu.toggleSidePanel('right');
|
|
||||||
await driver.find('.test-config-data').click();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
it('should filter a table selected by ref and reflist columns', async function() {
|
it('should filter a table selected by ref and reflist columns', async function() {
|
||||||
@ -182,7 +178,7 @@ describe('SelectByRefList', function() {
|
|||||||
* The values will depend on the link and the last row selected in the driving table.
|
* The values will depend on the link and the last row selected in the driving table.
|
||||||
*/
|
*/
|
||||||
async function checkSelectingRecords(selectBy: string, sourceData: string[][], newRow: string[]) {
|
async function checkSelectingRecords(selectBy: string, sourceData: string[][], newRow: string[]) {
|
||||||
await openSelectByForSection('LINKTARGET');
|
await gu.openSelectByForSection('LINKTARGET');
|
||||||
await driver.findContent('.test-select-row', new RegExp(selectBy + '$')).click();
|
await driver.findContent('.test-select-row', new RegExp(selectBy + '$')).click();
|
||||||
await gu.waitForServer();
|
await gu.waitForServer();
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@ import {addToRepl, assert, driver} from 'mocha-webdriver';
|
|||||||
import {enterRulePart, findDefaultRuleSet} from 'test/nbrowser/aclTestUtils';
|
import {enterRulePart, findDefaultRuleSet} from 'test/nbrowser/aclTestUtils';
|
||||||
import * as gu from 'test/nbrowser/gristUtils';
|
import * as gu from 'test/nbrowser/gristUtils';
|
||||||
import {server, setupTestSuite} from 'test/nbrowser/testUtils';
|
import {server, setupTestSuite} from 'test/nbrowser/testUtils';
|
||||||
import {openSelectByForSection} from "./RightPanelSelectBy";
|
|
||||||
|
|
||||||
describe('SelectBySummary', function() {
|
describe('SelectBySummary', function() {
|
||||||
this.timeout(50000);
|
this.timeout(50000);
|
||||||
@ -17,9 +16,6 @@ describe('SelectBySummary', function() {
|
|||||||
'SelectBySummary.grist', false);
|
'SelectBySummary.grist', false);
|
||||||
await driver.get(`${server.getHost()}/o/nasa/doc/${doc.id}`);
|
await driver.get(`${server.getHost()}/o/nasa/doc/${doc.id}`);
|
||||||
await gu.waitForDocToLoad();
|
await gu.waitForDocToLoad();
|
||||||
|
|
||||||
await gu.toggleSidePanel('right', 'open');
|
|
||||||
await driver.find('.test-config-data').click();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should filter a source table selected by a summary table', async function() {
|
it('should filter a source table selected by a summary table', async function() {
|
||||||
@ -219,7 +215,7 @@ async function checkSelectingRecords(
|
|||||||
) {
|
) {
|
||||||
const summarySection = `TABLE1 [by ${groubyColumns.join(', ')}]`;
|
const summarySection = `TABLE1 [by ${groubyColumns.join(', ')}]`;
|
||||||
|
|
||||||
await openSelectByForSection(targetSection);
|
await gu.openSelectByForSection(targetSection);
|
||||||
await driver.findContent('.test-select-row', summarySection).click();
|
await driver.findContent('.test-select-row', summarySection).click();
|
||||||
await gu.waitForServer();
|
await gu.waitForServer();
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import {addToRepl, assert, driver, Key} from 'mocha-webdriver';
|
import {addToRepl, assert, driver, Key} from 'mocha-webdriver';
|
||||||
import * as gu from 'test/nbrowser/gristUtils';
|
import * as gu from 'test/nbrowser/gristUtils';
|
||||||
import {server, setupTestSuite} from 'test/nbrowser/testUtils';
|
import {server, setupTestSuite} from 'test/nbrowser/testUtils';
|
||||||
import {openSelectByForSection} from "./RightPanelSelectBy";
|
|
||||||
|
|
||||||
describe('SelectBySummaryRef', function() {
|
describe('SelectBySummaryRef', function() {
|
||||||
this.timeout(20000);
|
this.timeout(20000);
|
||||||
@ -14,9 +13,6 @@ describe('SelectBySummaryRef', function() {
|
|||||||
'SelectBySummaryRef.grist', false);
|
'SelectBySummaryRef.grist', false);
|
||||||
await driver.get(`${server.getHost()}/o/nasa/doc/${doc.id}`);
|
await driver.get(`${server.getHost()}/o/nasa/doc/${doc.id}`);
|
||||||
await gu.waitForDocToLoad();
|
await gu.waitForDocToLoad();
|
||||||
|
|
||||||
await gu.toggleSidePanel('right', 'open');
|
|
||||||
await driver.find('.test-config-data').click();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should give correct options when linking with a summary table with ref/reflist columns', async () => {
|
it('should give correct options when linking with a summary table with ref/reflist columns', async () => {
|
||||||
@ -174,7 +170,7 @@ describe('SelectBySummaryRef', function() {
|
|||||||
|
|
||||||
// Check that the 'Select by' menu in the right panel for the section has the expected options
|
// Check that the 'Select by' menu in the right panel for the section has the expected options
|
||||||
async function checkRightPanelSelectByOptions(section: string, expected: string[]) {
|
async function checkRightPanelSelectByOptions(section: string, expected: string[]) {
|
||||||
await openSelectByForSection(section);
|
await gu.openSelectByForSection(section);
|
||||||
|
|
||||||
const actual = await driver.findAll('.test-select-menu .test-select-row', (e) => e.getText());
|
const actual = await driver.findAll('.test-select-menu .test-select-row', (e) => e.getText());
|
||||||
assert.deepEqual(actual, ['Select Widget', ...expected]);
|
assert.deepEqual(actual, ['Select Widget', ...expected]);
|
||||||
|
@ -53,7 +53,7 @@ async function applyPatchesToJquerylikeObject($) {
|
|||||||
// Adapt common old setup.
|
// Adapt common old setup.
|
||||||
const test = {
|
const test = {
|
||||||
setupTestSuite(self, ...args) {
|
setupTestSuite(self, ...args) {
|
||||||
self.timeout(20000);
|
self.timeout(40000);
|
||||||
return setupTestSuite(...args);
|
return setupTestSuite(...args);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -1759,6 +1759,16 @@ export async function openAccessRulesDropdown(): Promise<void> {
|
|||||||
await driver.findWait('.grist-floating-menu', 1000);
|
await driver.findWait('.grist-floating-menu', 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open "Select By" area in creator panel.
|
||||||
|
*/
|
||||||
|
export async function openSelectByForSection(section: string) {
|
||||||
|
await toggleSidePanel('right', 'open');
|
||||||
|
await driver.find('.test-config-data').click();
|
||||||
|
await getSection(section).click();
|
||||||
|
await driver.find('.test-right-select-by').click();
|
||||||
|
}
|
||||||
|
|
||||||
export async function editOrgAcls(): Promise<void> {
|
export async function editOrgAcls(): Promise<void> {
|
||||||
// To prevent a common flakiness problem, wait for a potentially open modal dialog
|
// To prevent a common flakiness problem, wait for a potentially open modal dialog
|
||||||
// to close before attempting to open the account menu.
|
// to close before attempting to open the account menu.
|
||||||
|
@ -65,14 +65,14 @@ export class TestServerMerged extends EventEmitter implements IMochaServer {
|
|||||||
await this.stop();
|
await this.stop();
|
||||||
}
|
}
|
||||||
this._starts++;
|
this._starts++;
|
||||||
|
const workerIdText = process.env.MOCHA_WORKER_ID || '0';
|
||||||
if (reset) {
|
if (reset) {
|
||||||
if (process.env.TESTDIR) {
|
if (process.env.TESTDIR) {
|
||||||
this.testDir = process.env.TESTDIR;
|
this.testDir = path.join(process.env.TESTDIR, workerIdText);
|
||||||
} else {
|
} else {
|
||||||
const workerId = process.env.MOCHA_WORKER_ID || '0';
|
|
||||||
// Create a testDir of the form grist_test_{USER}_{SERVER_NAME}_{WORKER_ID}, removing any previous one.
|
// Create a testDir of the form grist_test_{USER}_{SERVER_NAME}_{WORKER_ID}, removing any previous one.
|
||||||
const username = process.env.USER || "nobody";
|
const username = process.env.USER || "nobody";
|
||||||
this.testDir = path.join(tmpdir(), `grist_test_${username}_${this._name}_${workerId}`);
|
this.testDir = path.join(tmpdir(), `grist_test_${username}_${this._name}_${workerIdText}`);
|
||||||
await fse.remove(this.testDir);
|
await fse.remove(this.testDir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -99,7 +99,7 @@ export class TestServerMerged extends EventEmitter implements IMochaServer {
|
|||||||
// logging. Server code uses a global logger, so it's hard to separate out (especially so if
|
// logging. Server code uses a global logger, so it's hard to separate out (especially so if
|
||||||
// we ever run different servers for different tests).
|
// we ever run different servers for different tests).
|
||||||
const serverLog = process.env.VERBOSE ? 'inherit' : nodeLogFd;
|
const serverLog = process.env.VERBOSE ? 'inherit' : nodeLogFd;
|
||||||
const workerId = parseInt(process.env.MOCHA_WORKER_ID || '0', 10);
|
const workerId = parseInt(workerIdText, 10);
|
||||||
const corePort = String(8295 + workerId * 2);
|
const corePort = String(8295 + workerId * 2);
|
||||||
const untrustedPort = String(8295 + workerId * 2 + 1);
|
const untrustedPort = String(8295 + workerId * 2 + 1);
|
||||||
const env: Record<string, string> = {
|
const env: Record<string, string> = {
|
||||||
|
@ -64,4 +64,4 @@ TEST_ADD_SAMPLES=1 TEST_ACCOUNT_PASSWORD=not-needed \
|
|||||||
GRIST_SESSION_COOKIE=grist_test_cookie \
|
GRIST_SESSION_COOKIE=grist_test_cookie \
|
||||||
GRIST_TEST_LOGIN=1 \
|
GRIST_TEST_LOGIN=1 \
|
||||||
NODE_PATH=_build:_build/stubs \
|
NODE_PATH=_build:_build/stubs \
|
||||||
$MOCHA _build/test/deployment/*.js --slow 6000 -g "${GREP_TESTS}" "$@"
|
$MOCHA _build/test/deployment/*.js --slow 6000 -g "${GREP_TESTS:-}" "$@"
|
||||||
|
Loading…
Reference in New Issue
Block a user