If you are using oxygen.conf.js, pdf module must be added.
modules: ['web', 'log', 'assert', 'date', 'db', 'email', 'eyes', 'http', 'pdf']
Asserts that text is present in a PDF file
Parameters:
Name | Type | Description |
|
| Relative or absolute path to the PDF file. |
|
| Text to assert. |
|
|
|
|
|
|
|
|
|
pdf.assert('./Data/pdf.pdf', 'Hello World', 1, 'Text was not found in PDF')
Asserts that text is not present in a PDF file
Parameters:
Name | Type | Description |
|
| Relative or absolute path to the pdf file. |
|
| Text to assert. |
|
|
|
|
|
|
|
|
|
pdf.assertNot('./Data/pdf.pdf', 'Whats Up World', 1, 'Text was found in PDF')
Count the number of times specified text is present in a PDF file.
Parameters:
Name | Type | Description |
|
| Relative or absolute path to the pdf file. |
|
| Text to count. |
|
|
|
|
|
|
Returns:
Number
- Number of times the specified text was found.
var world_count = pdf.count('./Data/pdf.pdf', 'World', 1, true)log.info('The word World appears: ' + world_count + ' time inside this PDF')