nvdbleek / com.orbeon.testsuite.w3c Goto Github PK
View Code? Open in Web Editor NEWSelenium test runner for orbeon
Selenium test runner for orbeon
0. PRE REQUISITES (other implementers, please skip to section 4) # Orbeon installation 1. INSTALL # Copy build.properties.xml to build.properties.local.xml and fill in your Orbeon installation information # Execute target deploy-tests of build/build.xml using ant. 2. RUN # open your browser and navigate to http://localhost:8080/orbeon/xforms-test-suite/ 3. SOURCE OF TESTS You can find the src of the tests in src/tests (see next session for an example). Currently the following chapters have tests: * Chapter 2 * Chapter 3 * Chapter 4 * Chapter 5 * Chapter 6 * Chapter 7 * Chapter 10 * Chapter 11 * Appendix B 4. HOW IT WORKS The tests are written in a 'neutral' xml grammar. These xml files could be transformed to selenium html tests (using a stylesheet, use target generate-selenium-tests for it in build.xml). The tests can be found in src/tests (currently only Chapter 2 and 7 are completed) These generated selenium tests use user extensions in selenium to do the tests (see src/selenium/orbeon/user-extensions.js for an implementation of the user extension which work in Orbeon). Currently there is no stylesheet that transforms the xml test report, that is submitted back by the selenium web tests, to a w3c test suite result format. This I still something that needs to be written. The tests use a simple locator language for identifying the control to test or execute the operation on. The locator starts with the type of the control (e.g.: xf-output) followed by the occurrence number, in document order (e.g.: -1). When the control is in a repeat you can identify the iteration after a • (e.g.: •2). If you want to identify the 3th xforms output control you get xf-output-3. If that control is embedded in a repeat and you want to identify the control in the 2nd iteration the locator becomes xf-output-3•2 (for nested repeats just add the • separator and the iteration number). There is a stylesheet build/orbeon-xforms.xsl which can be ran on the XForms W3C test suite to assign id’s to the xforms controls that match the locator semantics. This can be an easy way to support the locators. Example test file: <?xml version="1.0" encoding="UTF-8"?> <test-case xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.w3c.org/MarkUp/Forms/XForms/Test/Runner" xmlns:xf="http://www.w3.org/2002/xforms" xsi:schemaLocation="http://www.w3c.org/MarkUp/Forms/XForms/Test/Runner ../test-case.xsd"> <!-- Open test form --> <open href="Chapt02/2.1.a.xhtml" /> <!-- Check if we opened the correct form, by looking at the title --> <assert-title title="2.1.a Introductory Example No. 1" /> <!-- Test if the selection and imput controls are present and available --> <assert-selection-options locator="xf-select1-1" options="Cash,Credit" /> <assert-control-present locator="xf-input-1" type="input" /> <assert-control-present locator="xf-input-2" type="input" /> <!-- Type input in the xforms input fields --> <type-input locator="xf-input-1" value="4012888888881881" /> <type-input locator="xf-input-2" value="2001-08" /> <!-- Click on the submission button --> <click locator="xf-submit-1" /> <!-- Wait for the replace all page to load --> <wait-for-page-to-load /> <!-- Check the title and some text on the page --> <assert-title title="Results from echo.sh" /> <assert-text-present text="<method>cc</method>" /> <assert-text-present text="<number>4012888888881881</number>" /> <assert-text-present text="<expiry>2001-08</expiry>" /> <!-- Open the test again --> <open href="Chapt02/2.1.a.xhtml" /> <!-- Check if we opened the correct form, by looking at the title --> <assert-title title="2.1.a Introductory Example No. 1" /> <!-- Select the option cache --> <select-option locator="xf-select1-1" option="Cash"/> <!-- Click on the submission button --> <click locator="xf-submit-1" /> <!-- Wait for the replace all page to load --> <wait-for-page-to-load /> <!-- Check the title and some text on the page --> <assert-title title="Results from echo.sh" /> <assert-text-present text="<method>cash</method>" /> <assert-text-present text="<number/>" /> <assert-text-present text="<expiry/>" /> </test-case>
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.