Tumgik
#like XCTest is already supposed to be able to do that. automagically scroll to elements that arent yet visible.
alsaurus-loves-dean · 2 months
Text
.
#LMAO why did i even bother working last week?????#I'm recovering from covid and i was feeling okay and i work from home#but goddamn i was stupid? like i spent three damn days on a problem#like wow the index gets fucked up when the framework scrolls to visible. how can i fix that#oh I'll just calculate the new index once I'm down there! oh wait thats crazy that doesnt work#oh I'll just calculate how far we need to scroll based on the position of the targeted index!#okay cool did that now I've scrolled so how to select?#I can't tap the one known unique element because tapping there doesnt open the page.....#there are no other unique elements besides ID number. but we don't know the ID until this element is created for the test ....#OH I'll just calculate the distance to a tappable element on that card from the element i know...#no that seems too complex. oh wait! when i find the item by the unique element i know. i can record that other ID!!!#so wait does tapping that ID open the page? YES!#okay so now I've done my fancy custom scroll . i have recorded the unique ID. i tap the unique ID! yay!#wait. CAN I JUST TAP DIRECTLY ON THAT ID NUMBER? FROM THE BEGINNING? WITHOIT THE FANCY SCROLL?#the scroll that takes FOREVER????#and turns out yeah. i can just tap directly on that ID. and the framework auto-scrolls. WAYYYY FASTER THAN MY STUPID SOLUTION LMFAO#like XCTest is already supposed to be able to do that. automagically scroll to elements that arent yet visible.#but the way we were tapping the items was dependent on the index#and the auto scroll fucked up that index calculation so it wasnt 'finding' the item even though we had already found it to scroll#but duh. DUH. just record the ID number and tap THAT. completely independent of it's position on the page. it's unique#I SPENT THREE DAYS ON THIS#and i solved in twenty minutes on a sunday#i am DYING.#and this is a ticket to implement scrolling because i thought SwiftUI was lazily loading the items#and the tapping wasnt working because when the item list is too long they're not on the hierarchy yet#but when i went in i was like. oh. we limited it to only check the minimum between number of items and... 10.#LOL i deadass on the ticket was like 'seems like the app only loads ten items at a time' without actually checking#so basically. i spent over a week on a ticket. that was two stupid self-inflicted problems in a trenchcoat#solvable in less than a day if i didnt have Covid Stupidity Syndrome omg.
1 note · View note