Skip to content

Commit 63446e6

Browse files
authored
🪟 🐛 Focus Connection Name input on field selection (#20162)
* fix using autofocus * see if this fixes e2e * debug e2e * cleanup
1 parent 8d658b7 commit 63446e6

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

airbyte-webapp-e2e-tests/cypress/integration/connection.spec.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
selectPrimaryKeyField,
2424
checkPreFilledPrimaryKeyField,
2525
checkStreamFields,
26-
expandStreamDetails
26+
expandStreamDetails,
2727
} from "pages/replicationPage";
2828
import { openSourceDestinationFromGrid, goToSourcePage } from "pages/sourcePage";
2929
import { goToSettingsPage } from "pages/settingsConnectionPage";
@@ -155,11 +155,6 @@ describe("Connection - main actions", () => {
155155

156156
createTestConnection(sourceName, destName);
157157

158-
cy.get("div").contains(sourceName).should("exist");
159-
cy.get("div").contains(destName).should("exist");
160-
161-
openSourceDestinationFromGrid(sourceName);
162-
163158
goToReplicationTab();
164159

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

560555
makeChangesInDBSource();
561-
openSourceDestinationFromGrid(sourceName);
562556
goToReplicationTab();
563557
refreshSourceSchemaBtnClick();
564558

airbyte-webapp-e2e-tests/cypress/pages/replicationPage.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,14 @@ export const selectCursorField = (value: string) => {
8080
cy.get(`.react-select__option`).contains(value).click();
8181
};
8282

83-
export const checkStreamFields = (listNames: Array<String>, listTypes: Array<String>,) => {
84-
cy.get(streamFieldNames)
85-
.each(($span, i) => {
86-
expect($span.text()).to.equal(listNames[i]);
87-
});
88-
89-
cy.get(streamDataTypes)
90-
.each(($span, i) => {
91-
expect($span.text()).to.equal(listTypes[i]);
92-
});
83+
export const checkStreamFields = (listNames: string[], listTypes: string[]) => {
84+
cy.get(streamFieldNames).each(($span, i) => {
85+
expect($span.text()).to.equal(listNames[i]);
86+
});
87+
88+
cy.get(streamDataTypes).each(($span, i) => {
89+
expect($span.text()).to.equal(listTypes[i]);
90+
});
9391
};
9492

9593
export const checkCursorField = (expectedValue: string) => {

airbyte-webapp/src/pages/ConnectionPage/pages/ConnectionItemPage/ConnectionName.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable jsx-a11y/no-autofocus */
12
import { faPenToSquare } from "@fortawesome/free-regular-svg-icons";
23
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
34
import React, { ChangeEvent, useState } from "react";
@@ -77,6 +78,7 @@ export const ConnectionName: React.FC = () => {
7778
onEscape={onEscape}
7879
onEnter={onEnter}
7980
disabled={loading}
81+
autoFocus
8082
/>
8183
</div>
8284
</div>

0 commit comments

Comments
 (0)