GithubHelp home page GithubHelp logo

umbraco-ui-tests's People

Contributors

peteduncanson avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

tiffy74

umbraco-ui-tests's Issues

Start identifying tests we can run per section

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:

  • "Content: should be able to create content"
  • "Content: shouldn't be shown doctypes that can't be created under the given node"
  • "Content: should prevent saving if a mandatory field is not filled in"

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.

Content: Create a base Page Object

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.

Login: Need an easy way to logout

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...

Login: Identify which ID's to add in Umbraco Core to ease finding some elements

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.

How to handle Localisation?

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:

  • Easy - we only support English. Add a test check to see if the users Language is set to English somehow and if not throw an error asap with instructions on how to fix/change language so they get a heads up.
  • Medium - save the different text in the config file so users can customise it. Users could import their language at the top of config via a require to over-power the strings we check against.
  • Harder and tightly coupled - poke around in the language files and use that to find out what text we should using for the current users language.

Need to restore a database to test against on each run

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...

Try the tests on 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.

Translations: Create Page Object

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.