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
Make it possible to create absolute path based on basePath #12
Comments
Alright, I'll add |
After 918076c this become critical. Actually... we have to review many tests again :( |
Q: what do we really need? We know the CKEditor base path thanks to I just realised that this may be harder than we thought. Because of #27 the path may change depending on group of tests unless in #27 we assumed that adding a test group which is kept outside Note - I want (I believe that we must) achieve a situation in which tests don't have to reviewed after moving them, adding other test groups, changes in the way how Bender generates paths, etc. Grzesiek - could you comment on that? I think we need more details about how tests paths are created and what happens with them depending on defined test groups. I'm very interested in case when we'll start keeping tests in plugins directories. |
The problem with CKEDITOR.basePath is that it is JS and in most cases we want to use absolute path in HTMLs head. Also it is Editors base path and we need tests base path. We should not build tests base path based on the editors base path. |
Have you got an example of test in which you need to access CKEditor files (only then you need to know its path) from the head of your test? And even if you need to do that, then you can do that from JS because there you can access The problem is assets path. |
OK, so we have to think about 2 scenarios:
|
Didn't #27 conditionally remove |
No, first you probably mean #26, second the old URL was: |
@Reinmar Paths like this should be IMHO absolute, not related: And based on the main tests folder, not on the CKEditor basePath. |
@pjasiun This is not a path to CKEditor directory!! This a path to assets directory in the tests. |
The only argument behind using absolute paths is when you start messing with test folder structure - moving some tests to subdirectories etc. it may still work, but you can break something... |
@Reinmar This is the type of the paths I would like to change using BASE_PATH. I never said I need a base path to the CKEditor. @gregpabian Exactly. I think that related path between tests is a bad idea, especially if we want to move them to plugins one day. |
Unfortunately there's one more argument - when an asset is kept in test directory and we use CKEditor API to load it (e.g. we're loading a styles set) we need a path relative to CKEditor.basePath... Am I right? |
Alright so I'm gonna implement it to point to current test group's base path. Just a quick question - should it contain a slash a the end or not? |
I just realised that it's enough. Main assets directory is kept outside of test groups directories. And making a path to this directory from e.g. a test in So I think that there must be defined the tests root - in this case it will point to |
@gregpabian I'm for slash at the end, so BASE_PATH would be "...tests/". |
Main assets directory is inside of every group's |
The problem I see is that if anything changes you're screwed. Just like now we are. Tests should be easy to write, easy to read and maintainable. Therefore constants controlled by Bender will be useful. They will make things simpler, cleaner and safer. |
Note - by cleaner I was referring to very long |
Because in the bender.js every test have a defined basePath it would be good the be able to create absolute paths based on basePath using some kind of macro (eg.: BASE_PATH/assets/lib.js), in both js and html files.
The text was updated successfully, but these errors were encountered: