Skip to content

Instantly share code, notes, and snippets.

@Vinay08sharma
Created September 24, 2021 05:35
Show Gist options
  • Save Vinay08sharma/805ef99dd81bb9dbc8e8b35a65c1d933 to your computer and use it in GitHub Desktop.
Save Vinay08sharma/805ef99dd81bb9dbc8e8b35a65c1d933 to your computer and use it in GitHub Desktop.
it('Verify on click of download PDF, PDF should be downloaded', async () => {
driver.navigate('url')
reporter.startStep('Clicking on download PDF button');
await topicPage.clickDownloadPDF();
await studentDriver.pause(20000); // Download take some time, you can add code to wait until file exist
const isPresent = DirectoryUtils.validateFileIsPresentInDirectory(filePath);
chaiExpect(isPresent,
'Expected the presence of file, but not found').to.be.true;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment