Skip to main content

Uploads and Downloads

Testronaut supports tests that require uploading/downloading files. Files that are used in tests will be in the following director by default:

missions/files/

Here's an example mission description that uses the upload feature:

import { runMissions } from 'testronaut';
import { loginMission } from './login.mission.js';
import { openDocumentsMission } from './openDocuments.mission.js';

export const uploadDocumentMission = `
Select the document uploader and select the "about-chickens.pdf" file from the missions/files.
It will take a several seconds for the upload to complete.
Confirm that the document has been uploaded by checking to see if the document is at the top of the Documents list, if its not there wait a few seconds.
Take a screenshot.
If successful, report SUCCESS stating the reason why.
Otherwise, report FAILURE stating the reason why.
`

export async function executeMission() {
return await runMissions({
preMission: [loginMission, openDocumentsMission],
mission: uploadDocumentMission,
}, "upload document mission");
}