super-productivity/e2e/commands/setupWebdavSync.ts
2025-07-18 16:05:43 +02:00

40 lines
1.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { NBrowser } from '../n-browser-interface';
module.exports = {
command(
this: NBrowser,
config: {
baseUrl: string;
username: string;
password: string;
syncFolderPath: string;
},
) {
// CSSSelektoren zentral definieren
const sel = {
syncBtn: 'button.sync-btn',
providerSelect: 'formly-field-mat-select mat-select',
providerOptionWebDAV: '#mat-option-3', // Eintrag „WebDAV“
baseUrlInput: '.e2e-baseUrl input',
userNameInput: '.e2e-userName input',
passwordInput: '.e2e-password input',
syncFolder: '.e2e-syncFolderPath input',
saveBtn: 'mat-dialog-actions button[mat-stroked-button]',
};
return this.click(sel.syncBtn)
.waitForElementVisible(sel.providerSelect)
.pause(100)
.click(sel.providerSelect)
.click(sel.providerOptionWebDAV)
.pause(100)
.setValue(sel.baseUrlInput, 'http://localhost:2345')
.setValue(sel.userNameInput, 'alice')
.setValue(sel.passwordInput, 'alice')
.setValue(sel.syncFolder, '/')
.pause(100)
.click(sel.saveBtn);
},
};