This commit is contained in:
SPRINX0\prochazka
2025-02-10 15:22:49 +01:00
parent 151230098c
commit 6bf5c58ec1
3 changed files with 15 additions and 4 deletions

View File

@@ -350,11 +350,13 @@ describe('Data browser data', () => {
cy.themeshot('comparesettings'); cy.themeshot('comparesettings');
}); });
it('Query editor - AI assistant', () => { it.only('Query editor - AI assistant', () => {
cy.contains('MySql-connection').click(); cy.contains('MySql-connection').click();
cy.contains('MyChinook').click(); cy.contains('MyChinook').click();
cy.testid('TabsPanel_buttonNewQuery').click(); cy.testid('TabsPanel_buttonNewQuery').click();
cy.testid('QueryTab_switchAiAssistantButton').click(); cy.testid('QueryTab_switchAiAssistantButton').click();
cy.testid('QueryAiAssistant_allowSendToAiServiceButton').click();
cy.testid('ConfirmModal_okButton').click();
cy.testid('QueryAiAssistant_promptInput').type('album names'); cy.testid('QueryAiAssistant_promptInput').type('album names');
cy.testid('QueryAiAssistant_queryFromQuestionButton').click(); cy.testid('QueryAiAssistant_queryFromQuestionButton').click();
cy.contains('Use this').click(); cy.contains('Use this').click();

View File

@@ -22,6 +22,9 @@ function clearTestingData() {
if (fs.existsSync(path.join(baseDir, 'connections-e2etests.jsonl'))) { if (fs.existsSync(path.join(baseDir, 'connections-e2etests.jsonl'))) {
fs.unlinkSync(path.join(baseDir, 'connections-e2etests.jsonl')); fs.unlinkSync(path.join(baseDir, 'connections-e2etests.jsonl'));
} }
if (fs.existsSync(path.join(baseDir, 'settings-e2etests.jsonl'))) {
fs.unlinkSync(path.join(baseDir, 'settings-e2etests.jsonl'));
}
if (fs.existsSync(path.join(baseDir, 'files-e2etests'))) { if (fs.existsSync(path.join(baseDir, 'files-e2etests'))) {
fs.rmdirSync(path.join(baseDir, 'files-e2etests'), { recursive: true }); fs.rmdirSync(path.join(baseDir, 'files-e2etests'), { recursive: true });
} }

View File

@@ -136,7 +136,7 @@ module.exports = {
deleteSettings_meta: true, deleteSettings_meta: true,
async deleteSettings() { async deleteSettings() {
await fs.unlink(path.join(datadir(), 'settings.json')); await fs.unlink(path.join(datadir(), processArgs.runE2eTests ? 'settings-e2etests.json' : 'settings.json'));
return true; return true;
}, },
@@ -161,7 +161,10 @@ module.exports = {
async loadSettings() { async loadSettings() {
try { try {
const settingsText = await fs.readFile(path.join(datadir(), 'settings.json'), { encoding: 'utf-8' }); const settingsText = await fs.readFile(
path.join(datadir(), processArgs.runE2eTests ? 'settings-e2etests.json' : 'settings.json'),
{ encoding: 'utf-8' }
);
return { return {
...this.fillMissingSettings(JSON.parse(settingsText)), ...this.fillMissingSettings(JSON.parse(settingsText)),
'other.licenseKey': platformInfo.isElectron ? await this.loadLicenseKey() : undefined, 'other.licenseKey': platformInfo.isElectron ? await this.loadLicenseKey() : undefined,
@@ -247,7 +250,10 @@ module.exports = {
...currentValue, ...currentValue,
..._.omit(values, ['other.licenseKey']), ..._.omit(values, ['other.licenseKey']),
}; };
await fs.writeFile(path.join(datadir(), 'settings.json'), JSON.stringify(updated, undefined, 2)); await fs.writeFile(
path.join(datadir(), processArgs.runE2eTests ? 'settings-e2etests.json' : 'settings.json'),
JSON.stringify(updated, undefined, 2)
);
// this.settingsValue = updated; // this.settingsValue = updated;
if (currentValue['other.licenseKey'] != values['other.licenseKey']) { if (currentValue['other.licenseKey'] != values['other.licenseKey']) {