-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It should be possible to load different fixture files in tests depending on a browser #2480
It should be possible to load different fixture files in tests depending on a browser #2480
Comments
@pomek (as a person who contributed to our test tools the most) could you take a look on the above and tell if there are any ready mechanisms which we can utilize to achieve this. Or maybe we already tried to solve similar issues in the past? What do you think will be the best way to tackle this task? |
What do you about a simple module that could export a function that will return required import basic_styles_safari from '...';
import basic_styles_default from '...';
export default function getFixtures( package ) {
// Check current browser.
// Check whether textures exists.
// etc.
return /* fixtures */
}; Something similar to |
What about webpack's dynamic imports? |
I have created a minimalistic version with static fixtures loading to see how (un)pleasant using it can be. It is doable but requires excessive amount of typing. The fixture loader is quite simple. It imports all fixtures indexes and generates an object with fixtures based on a browser in which tests are run (see https://github.com/ckeditor/ckeditor5-paste-from-office/blob/c2e7b96e1ddec587656d1515d3b6904238505f13/tests/_utils/fixtures.js). A fixture index is a file like I dug a little bit deeper to check if it would be feasible to adjust our ESLint config to enable dynamic imports. However, it seems that ESLint doesn't support nested |
Other: Support for pasting flat list and spacing handling for pasted content in Safari. Closes #1. Closes #12. Closes #15.
It is already mentioned in https://github.com/ckeditor/ckeditor5-paste-from-office/issues/1#issue-347950013 (2. Testing on different browsers). For many simple cases the raw clipboard data is the same when pasted from Word to Chrome, Firefox and Edge. However, it differs for Safari (and will also differ for more complex scenario like pasting images in other browsers).
At the moment fixtures are simply loaded via
import
:It could be done manually in each test file like:
but it produces a lot of redundant code. And it can be only done if
input.safari.word2016.html
file is present so all loading will need to be done manually.So it should be possible to load fixtures like:
Internally the
loadFixtures
will:input.BROWSER.word2016.html
file.input.word2016.html
.It will be also useful if the function can find all fixtures placed in a given folder/group itself (here
basic-styles
) so all the fixtures names don't have to be passed as an input to this function.The text was updated successfully, but these errors were encountered: