Hi I trying to make a test, I want to type the URL directly in the browser to simulate user typing. I use Jest, Puppeteer, JavaScript, and Node. I tried everything with Jquery with window, but navigation did not happen.
jsdom.JSDOM.fromURL('somedomian.com', { runScripts: "dangerously" }).then(dom => {
dom.window.location = window.location = Object.assign(new URL('https://somedomian.com/admin'));
});
jsdom.JSDOM.fromURL('somedomian.com', { runScripts: "dangerously" }).then(dom => {
dom.window.location = 'https://somedomian.com/admin';
});
jsdom.JSDOM.fromURL('somedomian.com', { runScripts: "dangerously" }).then(dom => {
dom.window.history.pushState({}, 'Admin Dashboard', '/admin/dashboard');
});
I can't find any solution with default Jest page functions something like page.browser()... or page.url() ... something.