peteduncanson / umbraco-ui-tests Goto Github PK
View Code? Open in Web Editor NEWA test suite for the back office of Umbraco CMS, so come help make it stronger :)
A test suite for the back office of Umbraco CMS, so come help make it stronger :)
Need to create a Page Object (see /v7/pageObjects/loginPage.js for an example) for the Media section.
Need to create a Page Object for the users section (see /v7/pageObjects/loginPage.js for an example)
Need to create a Page Object for the Developers section (see /v7/pageObjects/loginPage.js for an example)
I've been using the Login page as a test bed for putting the framework together to build the tests from, now that is nearing completion we need to start thinking about what we are actually going to test.
We shouldn't be testing stuff that could/should be tested via unit tests, these tests are not meant to be in the place of good unit tests but should be "as well as". That said there aren't any unit tests for Umbraco's back office (with the exception of a handful Lars added) so anything added regardless of method would be an improvement!
Ideally we could do with some time spent going through the back office and creating issues for what could/should be tested with this framework. Issues should start with the section that they are contained within and a description that we can pretty much use as the test name.
Some examples:
Another issue is test scope, how much should each test cover? Given the last example should we check that an error message is show as part of the "not saving"? I think it would be reasonable to do so. If so then we should mention that in the issues description along with any tips on how to recreate, element selectors etc. but these are optional and not a requirement. Knowing what to test is the hard bit that we are trying to get some details on.
Need to create a Page Object for the Settings section (see /v7/pageObjects/loginPage.js for an example)
Need a Page Object for the Content Section (see /v7/pageObjects/loginPage.js for an example) that can let us navigate to it (allowing for logging in if needed) and then controlling the tree. Not sure if the tree should be a whole separate Page Object but its only really used on Content...or is it? Something to ponder.
Noticed when running the tests that if you are already logged in then it won't show the login form but redirect you to the Content section. This means that some of the tests are randomly failing.
Need to ensure we "logout" before we "login", suggest this is something we do as part of the login function in LoginPage so its always done. I'm wondering if we can't just run some script that will blitz the cookie in the browser and then go to the login url. That should do it...
Suggest we try to get a PR in with a bunch of ids added to elements we want to easily get to. The templates in Umbraco Core were never written with testing in mind just "to get the job done" so adding some hooks in that we can latch onto would be super handy. Should be a quick win.
Only issue I can see is that we might get some name clashes if not careful. Might be worth name spacing the ids as a result, something like "login_forgottenEmailLink". Or something like that.
Elements I'm struggling with so far include the error messages (there are three of them), forgotten password form and link that shows it.
Where possible I've tried to not reference text values as much as I can however sometimes you can't avoid it.
If we have a Danish developer trying to help out then their text is going to be in Danish and some of the tests might fail. How best to test/allow for that?
Current thinking is we have a few options:
Need to create a Page Object for the Members section (see /v7/pageObjects/loginPage.js for an example)
To ensure we have a "clean" database each time we should really restore one a fresh at the start of each run.
Current thinking is to have a SQL CE database on disc as a "snapshot" that we can copy over to the /App_Data/ folder to replace the one we used for the last run. We could then mess around with the database via the Umbraco back office to add any content we want etc. take a copy of it for the "snap shot".
Need a script that will copy the snap shot db over the existing db before anything runs. Suspect this might need to be a JS task and I'm leaning towards adding this as a "npm script test" script for ease. Having a "npm script take-snap-shot" might be an idea too.
One issue we will have is SQL CE is meant to be getting ripped out of V8...
You might be wondering why I'm coding against V7 and not V8. The simple answer is that V7 is a known quantity, I know its not in flux so its safe to code against. My thinking was IF V7 is still going to be around for a few years we might as well have a test suite for it. Once we have that working then we can start porting it over to V8 and see what is broken. The specs themselves should be pretty reusable but I'm expecting the Page Objects to need some re-working between versions as things will have been renamed/moved/replaced/deleted.
If you simply can't wait to get stuck in with V8 then this is the issue for you. Copy the tests from the V7 folder over to V8 and see if they run and start patching them up so the broken ones do work.
Need to create a Page Object for the Translations section (see /v7/pageObjects/loginPage.js for an example).
Not sure if this one is worth spending too much time on as its meant to be getting all reworked soon I believe?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.