You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We noticed during the recent release of TinyPilot Pro 2.6.3 that the tests that verify the license links on the About dialog are correct fail when testing against an actual TinyPilot device.
The cause of the issue is that we're connecting to the TinyPilot device over HTTPS but without a valid certificate installed. The Playwright navigation functions ignore this, but the fetch function used to test the links fails due to the missing certificate.
We should ideally update the tests to use the Playwright navigation tools, or failing that; we should skip the tests when running in this fashion as part of our pre-release tests.
The text was updated successfully, but these errors were encountered:
I noticed that the documentation around e2e tests isn't comprehensive. For instance, I didn't know that our e2e tests require Node 18 or greater (for fetch()), so I ended up spending unnecessary time troubleshooting that. Additionally, our process in Notion shows this command:
However, the script doesn't use --base-url as an argument.
Our CONTRIBUTING file mentions to turn off "Require encrypted connection (HTTPS)" to run the e2e tests. If we follow that instruction, we could probably create a workaround replacing the https base url with http so the fetch() call doesn't run into the https/certificate issue.
test("checks that all license URLs are valid and reachable",async({
page,
baseURL,})=>{constlinks=awaitpage.locator("a.license").all();constpaths=awaitPromise.all(links.map((link)=>link.getAttribute("href")));consthttp_baseURL=baseURL.replace('https://','http://');constfailedUrls=[];awaitPromise.all(paths.map((path)=>`${http_baseURL}${path}`).map((url)=>fetch(url,{signal: AbortSignal.timeout(10000)}).then((res)=>{if(res.status!==200){failedUrls.push(url);}}).catch(()=>failedUrls.push(url))));expect(failedUrls.length,`License link broken for URLs: ${failedUrls.join(", ")}`).toBe(0);});
I've tested the workaround, and the tests pass using it. If we use this workaround, we don't have to use navigation functions or skip the tests. Does that seem like a reasonable solution?
We noticed during the recent release of TinyPilot Pro 2.6.3 that the tests that verify the license links on the About dialog are correct fail when testing against an actual TinyPilot device.
The cause of the issue is that we're connecting to the TinyPilot device over HTTPS but without a valid certificate installed. The Playwright navigation functions ignore this, but the
fetch
function used to test the links fails due to the missing certificate.We should ideally update the tests to use the Playwright navigation tools, or failing that; we should skip the tests when running in this fashion as part of our pre-release tests.
The text was updated successfully, but these errors were encountered: