@@ -73,21 +73,24 @@ const ensureSectionExpanded = async (driver: WebDriver): Promise<void> => {
7373const startEditingField = async ( driver : WebDriver , fieldId : string ) : Promise < void > => {
7474 // Ensure section is expanded first
7575 await ensureSectionExpanded ( driver ) ;
76-
76+
77+ // Enter edit mode first (new UI flow)
78+ await enterEditMode ( driver ) ;
79+
7780 const field = await findElementWithRetry ( driver , By . id ( fieldId ) , 10000 ) ;
78-
81+
7982 // Ensure field is visible and clickable
8083 assert ( await field . isDisplayed ( ) , `Field ${ fieldId } should be visible` ) ;
8184 assert ( await field . isEnabled ( ) , `Field ${ fieldId } should be enabled` ) ;
82-
85+
8386 // Scroll into view if needed (Windows compatibility)
8487 await driver . executeScript ( "arguments[0].scrollIntoView(true);" , field ) ;
8588 await sleep ( 500 ) ;
86-
89+
8790 // Click the field
8891 await field . click ( ) ;
89- console . log ( `Clicked ${ fieldId } , waiting for edit mode ...` ) ;
90-
92+ console . log ( `Clicked ${ fieldId } , waiting for input ...` ) ;
93+
9194 // Increased wait time for Windows compatibility - Vue reactivity needs time
9295 await sleep ( 2000 ) ;
9396} ;
@@ -146,28 +149,81 @@ const testDropdownEditing = async (driver: WebDriver, fieldId: string, selectId:
146149 await exitEditMode ( driver ) ;
147150} ;
148151
152+ // Helper function to enter edit mode by clicking the Edit button
153+ const enterEditMode = async ( driver : WebDriver ) : Promise < void > => {
154+ console . log ( "Entering edit mode..." ) ;
155+
156+ // Find and click the Edit button in the header
157+ const editButtons = await driver . findElements ( By . css ( '#ingestr-header button' ) ) ;
158+ for ( const button of editButtons ) {
159+ const text = await button . getText ( ) ;
160+ if ( text === 'Edit' ) {
161+ await button . click ( ) ;
162+ await sleep ( 1000 ) ;
163+ console . log ( "✓ Clicked Edit button" ) ;
164+ return ;
165+ }
166+ }
167+
168+ // Fallback: try finding button by text content
169+ const allButtons = await driver . findElements ( By . tagName ( 'button' ) ) ;
170+ for ( const button of allButtons ) {
171+ try {
172+ const text = await button . getText ( ) ;
173+ if ( text === 'Edit' ) {
174+ await button . click ( ) ;
175+ await sleep ( 1000 ) ;
176+ console . log ( "✓ Clicked Edit button (fallback)" ) ;
177+ return ;
178+ }
179+ } catch ( e ) {
180+ // Button might not be visible
181+ }
182+ }
183+
184+ console . log ( "⚠️ Edit button not found - might already be in edit mode" ) ;
185+ } ;
186+
187+ // Helper function to exit edit mode by clicking the Done button
188+ const exitEditModeWithButton = async ( driver : WebDriver ) : Promise < void > => {
189+ console . log ( "Exiting edit mode..." ) ;
190+
191+ const buttons = await driver . findElements ( By . css ( '#ingestr-header button' ) ) ;
192+ for ( const button of buttons ) {
193+ const text = await button . getText ( ) ;
194+ if ( text === 'Done' ) {
195+ await button . click ( ) ;
196+ await sleep ( 1000 ) ;
197+ console . log ( "✓ Clicked Done button" ) ;
198+ return ;
199+ }
200+ }
201+
202+ console . log ( "⚠️ Done button not found" ) ;
203+ } ;
204+
149205// Helper function to wait for the Ingestr component to be fully loaded
150206const waitForIngestrComponent = async ( driver : WebDriver ) : Promise < void > => {
151207 console . log ( "Waiting for Ingestr component to load..." ) ;
152-
208+
153209 // Wait for the main container
154210 await driver . wait ( until . elementLocated ( By . id ( "ingestr-asset-display" ) ) , 15000 ) ;
155211 console . log ( "✓ Ingestr asset display container found" ) ;
156-
212+
157213 // Wait for the section
158214 await driver . wait ( until . elementLocated ( By . id ( "ingestr-section" ) ) , 10000 ) ;
159215 console . log ( "✓ Ingestr section found" ) ;
160-
216+
161217 // Wait for the header
162218 await driver . wait ( until . elementLocated ( By . id ( "ingestr-header" ) ) , 10000 ) ;
163219 console . log ( "✓ Ingestr header found" ) ;
164-
220+
165221 // Ensure section is expanded
166222 await ensureSectionExpanded ( driver ) ;
167-
168- // Wait for at least one field to be present
169- await driver . wait ( until . elementLocated ( By . id ( "source-connection-field " ) ) , 10000 ) ;
170- console . log ( "✓ Ingestr fields are loaded" ) ;
223+
224+ // Wait for ingestr content to be present (rendered view)
225+ await driver . wait ( until . elementLocated ( By . id ( "ingestr-content " ) ) , 10000 ) ;
226+ console . log ( "✓ Ingestr content is loaded" ) ;
171227} ;
172228
173229describe ( "Ingestr Asset Display Integration Tests" , function ( ) {
@@ -657,8 +713,14 @@ describe("Ingestr Asset Display Integration Tests", function () {
657713
658714 describe ( "Required Fields Display" , function ( ) {
659715 before ( async function ( ) {
660- // Ensure section is expanded once for all tests in this group
716+ // Ensure section is expanded and enter edit mode for field tests
661717 await ensureSectionExpanded ( driver ) ;
718+ await enterEditMode ( driver ) ;
719+ } ) ;
720+
721+ after ( async function ( ) {
722+ // Exit edit mode after tests
723+ await exitEditModeWithButton ( driver ) ;
662724 } ) ;
663725
664726 it ( "should display source connection field with required indicator" , async function ( ) {
@@ -715,8 +777,14 @@ describe("Ingestr Asset Display Integration Tests", function () {
715777
716778 describe ( "Optional Fields Display" , function ( ) {
717779 before ( async function ( ) {
718- // Ensure section is expanded once for all tests in this group
780+ // Ensure section is expanded and enter edit mode for field tests
719781 await ensureSectionExpanded ( driver ) ;
782+ await enterEditMode ( driver ) ;
783+ } ) ;
784+
785+ after ( async function ( ) {
786+ // Exit edit mode after tests
787+ await exitEditModeWithButton ( driver ) ;
720788 } ) ;
721789
722790 it ( "should display incremental strategy field without required indicator" , async function ( ) {
@@ -756,8 +824,14 @@ describe("Ingestr Asset Display Integration Tests", function () {
756824
757825 describe ( "Interactive Functionality" , function ( ) {
758826 before ( async function ( ) {
759- // Ensure section is expanded once for all tests in this group
827+ // Ensure section is expanded and enter edit mode for field tests
760828 await ensureSectionExpanded ( driver ) ;
829+ await enterEditMode ( driver ) ;
830+ } ) ;
831+
832+ after ( async function ( ) {
833+ // Exit edit mode after tests
834+ await exitEditModeWithButton ( driver ) ;
761835 } ) ;
762836
763837 it ( "should be able to toggle section visibility" , async function ( ) {
@@ -817,8 +891,14 @@ describe("Ingestr Asset Display Integration Tests", function () {
817891
818892 describe ( "Field Editing Functionality" , function ( ) {
819893 before ( async function ( ) {
820- // Ensure section is expanded once for all tests in this group
894+ // Ensure section is expanded and enter edit mode for field tests
821895 await ensureSectionExpanded ( driver ) ;
896+ await enterEditMode ( driver ) ;
897+ } ) ;
898+
899+ after ( async function ( ) {
900+ // Exit edit mode after tests
901+ await exitEditModeWithButton ( driver ) ;
822902 } ) ;
823903
824904 it ( "should allow editing source connection field" , async function ( ) {
@@ -998,16 +1078,27 @@ describe("Ingestr Asset Display Integration Tests", function () {
9981078
9991079 describe ( "Dropdown Functionality" , function ( ) {
10001080 before ( async function ( ) {
1001- // Ensure section is expanded once for all tests in this group
1081+ // Ensure section is expanded and enter edit mode for field tests
10021082 await ensureSectionExpanded ( driver ) ;
1083+ await enterEditMode ( driver ) ;
10031084 } ) ;
10041085
1086+ after ( async function ( ) {
1087+ // Exit edit mode after tests
1088+ await exitEditModeWithButton ( driver ) ;
1089+ } ) ;
10051090 } ) ;
10061091
10071092 describe ( "Field Validation States" , function ( ) {
10081093 before ( async function ( ) {
1009- // Ensure section is expanded once for all tests in this group
1094+ // Ensure section is expanded and enter edit mode for field tests
10101095 await ensureSectionExpanded ( driver ) ;
1096+ await enterEditMode ( driver ) ;
1097+ } ) ;
1098+
1099+ after ( async function ( ) {
1100+ // Exit edit mode after tests
1101+ await exitEditModeWithButton ( driver ) ;
10111102 } ) ;
10121103
10131104 it ( "should show error styling for empty required fields" , async function ( ) {
@@ -1053,8 +1144,14 @@ describe("Ingestr Asset Display Integration Tests", function () {
10531144
10541145 describe ( "Keyboard Interaction" , function ( ) {
10551146 before ( async function ( ) {
1056- // Ensure section is expanded once for all tests in this group
1147+ // Ensure section is expanded and enter edit mode for field tests
10571148 await ensureSectionExpanded ( driver ) ;
1149+ await enterEditMode ( driver ) ;
1150+ } ) ;
1151+
1152+ after ( async function ( ) {
1153+ // Exit edit mode after tests
1154+ await exitEditModeWithButton ( driver ) ;
10581155 } ) ;
10591156
10601157 it ( "should handle ESC key to cancel editing" , async function ( ) {
@@ -1103,8 +1200,14 @@ describe("Ingestr Asset Display Integration Tests", function () {
11031200
11041201 describe ( "Field Value Display" , function ( ) {
11051202 before ( async function ( ) {
1106- // Ensure section is expanded once for all tests in this group
1203+ // Ensure section is expanded and enter edit mode for field tests
11071204 await ensureSectionExpanded ( driver ) ;
1205+ await enterEditMode ( driver ) ;
1206+ } ) ;
1207+
1208+ after ( async function ( ) {
1209+ // Exit edit mode after tests
1210+ await exitEditModeWithButton ( driver ) ;
11081211 } ) ;
11091212
11101213 it ( "should handle empty optional fields gracefully" , async function ( ) {
0 commit comments