Testing a website which relies on multiple JavaScript classes.
All classes are always loaded on the first test. Afterwards, not all classes are loaded.
All classes are always loaded.
I'm testing a html page, let's say index.html, which includes a JavaScript module as follows:
<script src="app.js" type="module"></script>
Additionally, app.js imports a JavaScript class:
import ExampleClass from './ExampleClass.js'
And this is how ExampleClass is defined:
export default class ExampleClass {
}
As for my test class, it defines the following fixture:
fixture`Example`
.page`index.html`
In this situation, if I run any number of tests, ExampleClass is only correctly loaded the first time. After the first test, no matter what this first test looks like, any other test logs a 404 for ExampleClass in the browser console. However, the local file's path as shown in the console log exists in the filesystem, although Testcaf茅 fails to find it.
Sample project: https://github.com/xalvarez/testcafe-import-class-issue
Please provide us with a sample project and test code, which demonstrate the issue.
I've written this sample project to reproduce the issue: https://github.com/xalvarez/testcafe-import-class-issue
@xalvarez
Hello,
Thank you for the sample project. I reproduced the issue under Windows 10 / Chrome 79. Our team will research it and check for a suitable solution.
Most helpful comment
@xalvarez
Hello,
Thank you for the sample project. I reproduced the issue under Windows 10 / Chrome 79. Our team will research it and check for a suitable solution.