Skip to content

Commit

Permalink
🪟 🐛 Focus Connection Name input on field selection (#20162)
Browse files Browse the repository at this point in the history
* fix using autofocus

* see if this fixes e2e

* debug e2e

* cleanup
  • Loading branch information
teallarson authored Jan 3, 2023
1 parent 8d658b7 commit 63446e6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
selectPrimaryKeyField,
checkPreFilledPrimaryKeyField,
checkStreamFields,
expandStreamDetails
expandStreamDetails,
} from "pages/replicationPage";
import { openSourceDestinationFromGrid, goToSourcePage } from "pages/sourcePage";
import { goToSettingsPage } from "pages/settingsConnectionPage";
Expand Down Expand Up @@ -155,11 +155,6 @@ describe("Connection - main actions", () => {

createTestConnection(sourceName, destName);

cy.get("div").contains(sourceName).should("exist");
cy.get("div").contains(destName).should("exist");

openSourceDestinationFromGrid(sourceName);

goToReplicationTab();

selectSchedule("Cron");
Expand Down Expand Up @@ -558,7 +553,6 @@ describe("Connection - detect changes in source", () => {
cy.get("div").contains(destName).should("exist");

makeChangesInDBSource();
openSourceDestinationFromGrid(sourceName);
goToReplicationTab();
refreshSourceSchemaBtnClick();

Expand Down
18 changes: 8 additions & 10 deletions airbyte-webapp-e2e-tests/cypress/pages/replicationPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,14 @@ export const selectCursorField = (value: string) => {
cy.get(`.react-select__option`).contains(value).click();
};

export const checkStreamFields = (listNames: Array<String>, listTypes: Array<String>,) => {
cy.get(streamFieldNames)
.each(($span, i) => {
expect($span.text()).to.equal(listNames[i]);
});

cy.get(streamDataTypes)
.each(($span, i) => {
expect($span.text()).to.equal(listTypes[i]);
});
export const checkStreamFields = (listNames: string[], listTypes: string[]) => {
cy.get(streamFieldNames).each(($span, i) => {
expect($span.text()).to.equal(listNames[i]);
});

cy.get(streamDataTypes).each(($span, i) => {
expect($span.text()).to.equal(listTypes[i]);
});
};

export const checkCursorField = (expectedValue: string) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable jsx-a11y/no-autofocus */
import { faPenToSquare } from "@fortawesome/free-regular-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import React, { ChangeEvent, useState } from "react";
Expand Down Expand Up @@ -77,6 +78,7 @@ export const ConnectionName: React.FC = () => {
onEscape={onEscape}
onEnter={onEnter}
disabled={loading}
autoFocus
/>
</div>
</div>
Expand Down

0 comments on commit 63446e6

Please sign in to comment.