Section 7.3. Using HTML for Tests


7.3. Using HTML for Tests

Fit was originally designed to work with HTML files. HTML files can be edited with Mozilla, FrontPage, or DreamWeaver or an editor that can save to HTML, such as MSWord or MSExcel.

Figure 7.4 shows a test being edited with Mozilla. Figure 7.5 shows a test being edited with MSWord. (It needs to be saved as an HTML file.)

Figure 7.4. Creating an HTML Table with Mozilla Composer


Figure 7.5. Editing an HTML File with MSWord


You can ornament your tables as you wish, as with spreadsheets, as most of the characteristics of an HTML table, such as the cell spacing or border size, are irrelevant to Fit. However, all tables are considered to be test tables by Fit, so you will get some odd reports if you use tables for other purposes. Other tagged formatting, such as formatted text, lists, images, and links, can be used both inside and around tables.[1]

[1] However, it would be confusing to color cells in ways that conflict with the changes that Fit makes to tables in reports.

Once the HTML is saved to a file, we can run Fit on it, using the same approach as in Section 7.1. Test suites, as described in Section 7.2, can include a mix of HTML files and spreadsheet files, and these files are reported in the same way. SetUp.html and TearDown.html files may also be provided, as alternatives to the spreadsheet equivalents.

Questions & Answers

Q1:

What if the text in a cell is italicized with <i>12.00</i>?

A1:

Fit ignores the tags and uses the plaintext 12.00 from the cell.

Q2:

Which HTML editor would you recommend?

A2:

FrontPage is very easy to use, and the HTML it creates is easy to edit directly as plaintext, if necessary. Mozilla also is good; it is free and runs everywhere.

Other editors create masses of HTML for simple things. However, if you don't need to alter the HTML directly and you usually use MSWord for word processing, use it for editing your HTML.

Q3:

What are the pros and cons of HTML versus spreadsheets?

A3:

The grid is already there with a spreadsheet, so it's easier to get started. However, if you have several tables in the spreadsheet, you end up having to resize the column widths to suit all the tables. This can look messy. HTML tables can be sized automatically and independently.

HTML also allows images and links to be used, which may be useful.



    Fit for Developing Software. Framework for Integrated Tests
    Fit for Developing Software: Framework for Integrated Tests
    ISBN: 0321269349
    EAN: 2147483647
    Year: 2005
    Pages: 331

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net