//************************************************************************** // // // National Institute Of Standards and Technology // DTS Version 1.1 // // HTMLButtonElement Interface //************************************************************************** function HTMLButtonElement() { var tests = new Array (HTML0001BE(),HTML0002BE(),HTML0003BE(),HTML0004BE(),HTML0005BE(),HTML0006BE(),HTML0007BE(),HTML0008BE()); return tests; } //------------------------ test case HTML-0001BE ------------------------- // // Testing feature - The "form" attribute returns the FORM containing // this control. // // Testing approach - Retrieve the first BUTTON element of the testing // document and examine its "form" attribute. It // should be equal to an HTMLFormElement whose // name attribute is equal to "form3". // // Semantic Requirements: 1 // // Last modification date - October 15, 1999 // // Written by: Mark LaRoy Zimmerman //---------------------------------------------------------------------------- function HTML0001BE() { var computedValue = ""; var expectedValue = "FORM2"; var results = ""; var testNode = ""; results = new testResults("HTML0001BE"); results.description = "The \"form\" attribute returns the FORM "+ "containing this control."; // // Retrieve targeted data. // testNode = new HTMLNodeObject(BUTTON,FIRST); // // and access attribute. // computedValue = testNode.node.form.id; computedValue = computedValue.toUpperCase(); // // Write out results // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ end test case HTML-0001BE ------------------------- // //------------------------ test case HTML-0002BE ------------------------- // // Testing feature - The "form" attribute returns null if control is not // within the context of a form. // // Testing approach - Retrieve the first BUTTON element of the testing // document and examine its "form" attribute. It // should be equal to an HTMLFormElement whose // name attribute is equal to "form3". // // Semantic Requirements: 1 // // Last modification date - October 15, 1999 // // Written by: Mark LaRoy Zimmerman //---------------------------------------------------------------------------- function HTML0002BE() { var computedValue = ""; var expectedValue = null; var results = ""; var testNode = ""; results = new testResults("HTML0002BE"); results.description = "The \"form\" attribute returns null if the control "+ "is not within the context of a form."; // // Retrieve targeted data. // testNode = new HTMLNodeObject(BUTTON,SECOND); // // and access attribute. // computedValue = testNode.node.form; // // Write out results // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ end test case HTML-0002BE ------------------------- // //------------------------- test case HTML-0003BE --------------------------- // // Testing feature - The "accessKey" attribute is a single character access // key to give access to the form control. // // Testing approach - Retrieve the first BUTTON element of the testing // document and examine its "accessKey" attribute. It // should be equal to "F". // // Semantic Requirements: 2 // // Last modification date - October 15, 1999 // // Written by: Mark LaRoy Zimmerman //---------------------------------------------------------------------------- function HTML0003BE() { var computedValue = ""; var expectedValue = "F"; var results = ""; var testNode = ""; results = new testResults("HTML0003BE"); results.description = "The \"accessKey\" attribute is a single character "+ "access key to give access to the form control."; // // Retrieve targeted data. // testNode = new HTMLNodeObject(BUTTON,FIRST); // // and access attribute. // computedValue = testNode.node.accessKey; computedValue = computedValue.toUpperCase(); // // Write out results // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ end test case HTML-0003BE ------------------------- // //------------------------- test case HTML-0004BE --------------------------- // // Testing feature - The "disabled" attribute has a TRUE value if it is // explicitly set. // // Testing approach - Retrieve the first BUTTON element of the testing // document and examine its "disabled" attribute. It // should be equal to true. // // Semantic Requirements: 3 // // Last modification date - October 15, 1999 // // Written by: Mark LaRoy Zimmerman //---------------------------------------------------------------------------- function HTML0004BE() { var computedValue = ""; var expectedValue = true; var results = ""; var testNode = ""; results = new testResults("HTML0004BE"); results.description = "The \"disabled\" attribute has a TRUE value "+ "if it is explicitly set."; // // Retrieve targeted data. // testNode = new HTMLNodeObject(BUTTON,FIRST); // // and access attribute. // computedValue = testNode.node.disabled; // // Write out results // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ end test case HTML-0004BE ------------------------- // //------------------------- test case HTML-0005BE --------------------------- // // Testing feature - The "name" attribute is the form control or object // name when submitted with a form. // // Testing approach - Retrieve the first BUTTON element of the testing // document and examine its "name" attribute. It // should be equal to "DISABLEDBUTTON". // // Semantic Requirements: 4 // // Last modification date - October 15, 1999 // // Written by: Mark LaRoy Zimmerman //---------------------------------------------------------------------------- function HTML0005BE() { var computedValue = ""; var expectedValue = "DISABLEDBUTTON"; var results = ""; var testNode = ""; results = new testResults("HTML0005BE"); results.description = "The \"name\" attribute is the form control or "+ "object name when submitted with a form."; // // Retrieve targeted data. // testNode = new HTMLNodeObject(BUTTON,FIRST); // // and access attribute. // computedValue = testNode.node.name; computedValue = computedValue.toUpperCase(); // // Write out results // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ end test case HTML-0005BE ------------------------- // //------------------------- test case HTML-0006BE --------------------------- // // Testing feature - The "tabIndex" attribute is an index that represents // the element's position in the tabbing order. // // Testing approach - Retrieve the first BUTTON element of the testing // document and examine its "tabIndex" attribute. It // should be equal to 20. // // Semantic Requirements: 5 // // Last modification date - October 25, 1999 // // Written by: Mark LaRoy Zimmerman //---------------------------------------------------------------------------- function HTML0006BE() { var computedValue = ""; var expectedValue = 20; var results = ""; var testNode = ""; results = new testResults("HTML0006BE"); results.description = "The \"tabIndex\" attribute is an index that "+ "represents the element's position in the "+ "tabbing order."; // // Retrieve targeted data. // testNode = new HTMLNodeObject(BUTTON,FIRST); // // and access attribute. // computedValue = testNode.node.tabIndex; // // Write out results // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ end test case HTML-0006BE ------------------------- // //------------------------- test case HTML-0007BE --------------------------- // // Testing feature - The "type" attribute is the type of button. // // Testing approach - Retrieve the first BUTTON element of the testing // document and examine its "type" attribute. It // should be equal to "RESET". // // Semantic Requirements: 6 // // Last modification date - October 15, 1999 // // Written by: Mark LaRoy Zimmerman //---------------------------------------------------------------------------- function HTML0007BE() { var computedValue = ""; var expectedValue = "RESET"; var results = ""; var testNode = ""; results = new testResults("HTML0007BE"); results.description = "The \"type\" attribute is the type of button"; // // Retrieve targeted data. // testNode = new HTMLNodeObject(BUTTON,FIRST); // // and access attribute. // computedValue = testNode.node.type; computedValue = computedValue.toUpperCase(); // // Write out results // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ end test case HTML-0007BE ------------------------- // //------------------------- test case HTML-0008BE --------------------------- // // Testing feature - The "value" attribute is the current form control value. // // Testing approach - Retrieve the first BUTTON element of the testing // document and examine its "value" attribute. It // should be equal to "RESET DISABLED BUTTON". // // Semantic Requirements:7 // // Last modification date - October 15, 1999 // // Written by: Mark LaRoy Zimmerman //---------------------------------------------------------------------------- function HTML0008BE() { var computedValue = ""; var expectedValue = "RESET DISABLED BUTTON"; var results = ""; var testNode = ""; results = new testResults("HTML0008BE"); results.description = "The \"value\" attribute is the current form "+ "control value."; // // Retrieve targeted data. // testNode = new HTMLNodeObject(BUTTON,FIRST); // // and access attribute. // computedValue = testNode.node.value; computedValue = computedValue.toUpperCase(); // // Write out results // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ end test case HTML-0008BE -------------------------