Skip to content

Commit

Permalink
update createTestConnection function with optional replication settings
Browse files Browse the repository at this point in the history
  • Loading branch information
dizel852 committed Dec 29, 2022
1 parent 5ab5841 commit 8e47c78
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions airbyte-webapp-e2e-tests/cypress/commands/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@ import { createPokeApiSource, createPostgresSource } from "./source";
import { openAddSource } from "pages/destinationPage";
import { selectSchedule, setupDestinationNamespaceSourceFormat, enterConnectionName } from "pages/replicationPage";

export const createTestConnection = (sourceName: string, destinationName: string) => {
enum Schedule {
MANUAL = "Manual",
}

interface ReplicationSettings {
schedule: Schedule;
}

export const createTestConnection = (
sourceName: string,
destinationName: string,
connectionSettings: ReplicationSettings = {} as ReplicationSettings
) => {
cy.intercept("/api/v1/sources/discover_schema").as("discoverSchema");
cy.intercept("/api/v1/web_backend/connections/create").as("createConnection");

Expand Down Expand Up @@ -37,11 +49,12 @@ export const createTestConnection = (sourceName: string, destinationName: string
cy.get("div").contains(sourceName).click();

cy.wait("@discoverSchema");

enterConnectionName("Connection name");
selectSchedule("Manual");

setupDestinationNamespaceSourceFormat();
const { schedule } = connectionSettings;
// enterConnectionName("Connection name"); // FIXME: do we need to append tha string to name?
if (schedule) {
selectSchedule(schedule);
}
// setupDestinationNamespaceSourceFormat(); // FIXME: do we need just to click on inputs?
submitButtonClick();

cy.wait("@createConnection", { requestTimeout: 10000 });
Expand Down

0 comments on commit 8e47c78

Please sign in to comment.