Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Descriptive XML Smoke Test Scenarios"

(XML Smoke Test Scenarios)
(XML Smoke Test Scenarios)
Line 13: Line 13:
  
 
'''Add/Modify Tests'''
 
'''Add/Modify Tests'''
 +
 +
'''Note:''' if you use an XML file which is validated to an XML Schema, certain functions like Add Attribute cannot be tested.  In these cases, use a new XML file.
  
 
# New element: add a new element from the Outline view via right clicking on the root element -> Add Child -> New Element ... (if the XML document has a schema, New Element ... will be replaced with a valid element to add)
 
# New element: add a new element from the Outline view via right clicking on the root element -> Add Child -> New Element ... (if the XML document has a schema, New Element ... will be replaced with a valid element to add)

Revision as of 11:41, 19 September 2008

XML Smoke Test Scenarios

Example Setup

Examples found via: New -> Example ... -> Editing and validating XML files


Open and Close Editor

  1. Workspace XML file: open an XML file from the workspace and verify its content
  2. Non-workspace XML file: open an XML file from outside the workspace and verify its content. In addition, edit this file from an external editor and ensure a File changed dialog appears in Eclipse


Add/Modify Tests

Note: if you use an XML file which is validated to an XML Schema, certain functions like Add Attribute cannot be tested. In these cases, use a new XML file.

  1. New element: add a new element from the Outline view via right clicking on the root element -> Add Child -> New Element ... (if the XML document has a schema, New Element ... will be replaced with a valid element to add)
  2. New comment: add a new comment from the Outline view via right clicking on any element and [AddChild | AddBefore | AddAfter] -> Comment
  3. New processing instruction: add new processing instruction from the Outline view view right clicking on the root element and Add Before -> Add Processing Instruction
  4. New attribute: add a new attribute from the Outline view via right clicking on an element -> Add Attribute
  5. New DTD Information: add DTD Information from the outline view via right click on the root element -> Add DTD Information ...
  6. New #PCData: if DTD Information was added, add #PCData from the Outline view via right clicking on an element -> #PCData;
  7. New CDATA: if DTD Information was added, add CDATA Section from the Outline view via right clicking on an element -> CDATA Section
  8. Repeat the previous Add/Modify tests using the Design view
  9. Make changes to the attributes or element values in Design view and verify changes by switching to the Source view


Selection Tests

Go to various nodes like root and children nodes for testing synchronization between the properties, source, outline, and design views. The outline view should automatically expand it's hierarchy when selecting nodes in previously collapsed nodes in this view.


Drag & Drop Tests

  1. Reorder elements: drag elements in different order in Design View and in Outline View. In both cases, ensure both views are synchronized
  2. Create child elements: drag elements such that the newly dragged item is over a highlighted element. This makes the dragged element a child of the highlighted element. Do this in both Design View and Outline View and verify both views are synchronized


Delete Tests

  1. Right click on a non-root element, attribute, DTD Information, PCData, CDATA, and processing instruction and select remove
  2. Remove the root element and ensure all children are removed


Source Editing

  1. As you type validation: select an XML file with a schema and insert or modify an entry that violates the schema. As you are typing, a red underline appears and if you mouse over the underlined text will show an error message
  2. Content assist: select an XML file with a schema and do CTRL+SPACE in the root element or in children elements to bring up possible elements to add. Do the same for an attribute by removing the attribute and using content assist to reinsert a valid attribute.
  3. Context menus: right click in the Design, Outline, and Source view to check the context menus
  4. Switching between Design and Source view: make sure changes to the source are reflected in the Design view
  5. Formatting: in the Source view, right click -> source -> Format. Now untab some elements by selecting elements and using SHIFT+TAB. To reformat, right click -> source -> Format.
  6. Toggle comment: in Source view, right click -> source -> Toggle Comment
  7. Add block comment: in Source view, right click -> source -> Add Block Comment
  8. Remove block comment: in Source view, right click while inside a block comment -> source -> Remove block Comment


File Creation & Saving

  1. Use save and save-as on XML files
  2. Close without saving, changes should not be committed
  3. Open existing XML file
  4. Create a new XML file via File -> New -> Other... -> XML folder -> XML. Try Create XML from a DTD file, Create XML file from XML Schema file, and Create XML file from an XML template


Validation

Right click on an XML file which has an XML Schema and select Validate. The expected result is a prompt indicating there where no warnings or errors. Modify the XML file such that the XML file is no longer valid based on the XML Schema

  1. Look for the red underline on the invalid entry
  2. Mouse over the invalid entry to see the error message
  3. Validate the invalid XML file and expect: a prompt with an error message, a red X in the Package Explorer view for the XML file, and the error reported in the Problem view
  4. Modify the value to make the XML file valid again and Validate. The errors should be removed.


Refactor

  1. Rename: in the Package Explorer view, right click on an XML file -> Refactor -> Rename
  2. Move: in the Package Explorer view, right click on an XML file -> Refactor -> Move


Back to WTP 3.0 Test Scenarios

Copyright © Eclipse Foundation, Inc. All Rights Reserved.