chore: working with builder xml require vs dynamic import wip

This commit is contained in:
Nathan Walker
2025-07-22 14:37:11 -07:00
parent b4579d1d2f
commit 0ba0ab0d59
23 changed files with 141 additions and 121 deletions

View File

@@ -23,6 +23,7 @@ function runTests() {
export function onNavigatedTo(args) {
args.object.off(Page.loadedEvent, onNavigatedTo);
console.log('onNavigatedTo called', executeTests);
if (executeTests) {
executeTests = false;
runTests();

View File

@@ -455,6 +455,7 @@ function getAllProperties(obj: any) {
let testsSelector: string;
export function runAll(testSelector?: string) {
testsSelector = testSelector;
console.log('runAll called with:', testSelector);
if (running) {
// TODO: We may schedule pending run requests
return;

View File

@@ -359,6 +359,7 @@ export function waitUntilReady(isReady: () => boolean, timeoutSec: number = 5, s
const currentRunLoop = NSRunLoop.currentRunLoop;
currentRunLoop.limitDateForMode(currentRunLoop.currentMode);
if (isReady()) {
console.log('waitUntilReady: isReady() returned true');
break;
}

View File

@@ -203,11 +203,13 @@ export function waitUntilNavigatedFrom(action: Function, topFrame?: Frame) {
const currentPage = topFrame ? topFrame.currentPage : Frame.topmost().currentPage;
let completed = false;
function navigatedFrom(args) {
console.log('navigatedFrom called');
args.object.page.off('navigatedFrom', navigatedFrom);
completed = true;
}
currentPage.on('navigatedFrom', navigatedFrom);
console.log('calling action!');
action();
TKUnit.waitUntilReady(() => completed);
}