PDFs

Verify Clockify dynamic PDF content

Industry
Productivity
Problem types
Uploading and downloading
DOM-less content

This test executes an end-to-end workflow with a previously registered Clockify user. The user logs into a previously-established Clockify account, starts the timer for a task, waits five seconds, and then stops the task. The user then goes directly to the Reports page and selects the option to generate a PDF file, which automatically downloads that file. The user then switches to the Mozilla PDF-to-HTML converter and uploads the file that was generated in the last step. The user converts the PDF file to HTML and automatically downloads the HTML file. The user then opens the HTML file in the browser and the test asserts that the report contains information on the specific task that was started and stopped in Clockify.

How it's done

PDF-to-HTML conversion

In this test, we easily found a code snippet using our in-house knowledge base that used Mozilla’s PDF-to-HTML converter. We simply copied into our test. Once our PDF was in HTML, we opened it in a browser and used the DOM to access the elements we needed.

File downloads

Whenever a test is executed on the QA Wolf platform, we spin up an entirely new instance for that test and tear it down at the end of the test. That means that any artifacts that are generated as a result of the test are automatically destroyed, which saves testers having to worry about whether artifact accumulation will fill a disk and cause a false positive because that will never happen. That means that when we wrote this test, we weren’t subject to any restrictions due to file permissions or disk capacity. 

Managing multiple domains

Using Playwright instead of Cypress or Selenium lets our tests visit multiple domains, allowing use to go to both Clockify.com and the Mozilla PDF-to-HTML converter site. Because of the way we've architected our platform, our tests are not subject to security policies that prevent other testing frameworks from visiting more than one site in the same test.

See also

We use cookies to
improve your experience.