test: Credential test migration part 1 (#19420)

This commit is contained in:
Declan Carroll
2025-09-12 12:32:04 +01:00
committed by GitHub
parent 752436d1e4
commit 1a1c07d6eb
18 changed files with 740 additions and 499 deletions

View File

@@ -5,13 +5,17 @@ test.describe('OAuth Credentials', () => {
const projectId = await n8n.start.fromNewProjectBlankCanvas();
await page.goto(`projects/${projectId}/credentials`);
await n8n.credentials.emptyListCreateCredentialButton.click();
await n8n.credentials.openNewCredentialDialogFromCredentialList('Google OAuth2 API');
await n8n.credentials.fillCredentialField('clientId', 'test-key');
await n8n.credentials.fillCredentialField('clientSecret', 'test-secret');
await n8n.credentials.saveCredential();
await n8n.credentials.createCredentialFromCredentialPicker(
'Google OAuth2 API',
{
clientId: 'test-key',
clientSecret: 'test-secret',
},
{ closeDialog: false },
);
const popupPromise = page.waitForEvent('popup');
await n8n.credentials.getOauthConnectButton().click();
await n8n.credentials.credentialModal.oauthConnectButton.click();
const popup = await popupPromise;
const popupUrl = popup.url();
@@ -25,7 +29,8 @@ test.describe('OAuth Credentials', () => {
channel.postMessage('success');
});
await expect(n8n.credentials.getSaveButton()).toContainText('Saved');
await expect(n8n.credentials.getOauthConnectSuccessBanner()).toContainText('Account connected');
await expect(n8n.credentials.credentialModal.oauthConnectSuccessBanner).toContainText(
'Account connected',
);
});
});