Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Descriptive XML Smoke Test Scenarios

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 using an XML Document with XML Schema validation

Uses the example XML file GolfCountryClub/GolfCountryClub.xml

  1. New element: in the Outline View -> right click on the root element -> Add Child. You should only see three options for elements: Employee, GolfCourse, and Member. You should not see the option for adding a New Element... Choose any element and ensure it appears in the Design, Source, and Outline view
  2. New element and Content Assist: in the Sources view, put the cursor directly after "<GolfCourse NumberOfHoles="18">" and press CTRL+SPACE. The possible elements to add will be displayed. Choose any element and ensure it appears in the Design, Source, and Outline view
  3. New attribute: in the Source view find the element "<GolfCourse NumberOfHoles="18">" and remove the text "NumberOfHoles="18"". While inside the "<GolfCourse>" element, press CTRL+SPACE and the content assist should tell you the attribute and value "NumberOfHoles="18" should be added. Choose this value and ensure it appears in the Source view. In the Outline View, right click on this element and the Add Attributes option should not appear. Now remove the text "NumberOfHoles="18"" and right click on the element in the Outline View. There should now be an Add Attributes option with NumberOfHoles as an option. Choose this option and the attribute "NumberOfHoles="18"" should be added to the element


Add/Modify Tests using an XML Document without XML Schema validation

  1. Create a new empty XML document: from Menubar, File -> New -> Other... -> find the XML folder in the list and select XML -> choose a directory -> press the Finish button
  2. New element and Content Assist: in the Source view, create a root element like "<root>" -> use CTRL+SPACE while the caret is directly after the element to bring up the content assist -> select Ends with "</root>" (replace root with the name of your starting element)
  3. New element: from the previous step, right click on the newly created root element in the Outline view -> Add Child -> New Element... -> enter a name and press OK. Ensure the newly added element shows up in the Design, Source, and Outline View
  4. New attribute: in the Outline view, right click on the newly created element from the previous step -> Add Attribute -> New Attribute... -> enter a name and value -> press OK


Add/Modify Tests using any XML Document

  1. New comment: add a new comment from the Outline view via right clicking on any element and [AddChild | AddBefore | AddAfter] -> Comment
  2. New processing instruction: add new processing instruction from the Outline view view right clicking on the root element and Add Before -> Add Processing Instruction
  3. New DTD Information: add DTD Information from the outline view via right click on the root element -> Add DTD Information ...
  4. New #PCData: if DTD Information was added, add #PCData from the Outline view via right clicking on an element -> #PCData;
  5. New CDATA: if DTD Information was added, add CDATA Section from the Outline view via right clicking on an element -> CDATA Section
  6. Repeat the previous Add/Modify tests using the Design view
  7. 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 -> 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 were 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

Back to the top