gitbutler/apps/desktop/e2e/tests/add-project.spec.ts
Nico Domino 11ff8a71cc
feat: initial addProject test with WebdriverIO (#4589)
Co-authored-by: Mattias Granlund <mtsgrd@gmail.com>
Co-authored-by: Test User <test@example.com>
2024-08-13 17:31:19 +02:00

26 lines
879 B
TypeScript

import { setElementValue, spawnAndLog, findAndClick } from '../utils.js';
describe('Project', () => {
before(() => {
spawnAndLog('bash', [
'-c',
'./e2e/scripts/init-repositories.sh ../../target/debug/gitbutler-cli'
]);
});
it('should add a local project', async () => {
await findAndClick('button[data-testid="analytics-continue"]');
// Workaround selecting path via fileDialog by setting a hidden input value
const dirInput = await $('input[data-testid="test-directory-path"]');
setElementValue(dirInput, `/tmp/gb-e2e-repos/one-vbranch-on-integration`);
await findAndClick('button[data-testid="add-local-project"]');
await findAndClick('button[data-testid="set-base-branch"]');
await findAndClick('button[data-testid="accept-git-auth"]');
const workspaceButton = await $('button=Workspace');
await expect(workspaceButton).toExist();
});
});