Permalink
Browse files

added test to try to reproduce issue reported

  • Loading branch information...
cheezy committed Dec 18, 2013
1 parent 5b71ebb commit 0aa38127061be65155fa1da425828ae53e9300a1
Showing with 30 additions and 18 deletions.
  1. +12 −4 features/html/static_elements.html
  2. +5 −0 features/step_definitions/table_steps.rb
  3. +13 −14 features/table.feature
@@ -85,14 +85,22 @@
</label>
<table id='table_id' name='table_name' class='table_class' border='1'>
+ <thead>
<tr>
- <td>Data1</td>
- <td>Data2</td>
+ <th>Table</th>
+ <th>Header</th>
</tr>
+ </thead>
+ <tbody>
<tr>
- <td>Data3</td>
- <td id='cell_id' name='cell_name' class='cell_class'>Data4</td>
+ <td>Data1</td>
+ <td>Data2</td>
</tr>
+ <tr>
+ <td>Data3</td>
+ <td id='cell_id' name='cell_name' class='cell_class'>Data4</td>
+ </tr>
+ </tbody>
</table>
<table id='table_with_thead_id' border='1'>
@@ -31,6 +31,11 @@
@element.first_row[1].text.should == col2
end
+Then /^the data for the second row should be "([^\"]*)" and "([^\"]*)"$/ do |col1, col2|
+ @element[1][0].text.should == col1
+ @element[1][1].text.should == col2
+end
+
Then /^the data for the last row should be "([^\"]*)" and "([^\"]*)"$/ do |col1, col2|
@element.last_row[0].text.should == col1
@element.last_row[1].text.should == col2
View
@@ -15,15 +15,14 @@ Feature: Table
When I retrieve a table element
Then I should know it exists
+@focus
Scenario: Retrieve the data from a table
When I retrieve a table element
- Then the data for row "1" should be "Data1" and "Data2"
- And the data for row "2" should be "Data3" and "Data4"
- And the table should have "2" rows
- And each row should contain "Data"
- And row "1" should have "2" columns
- And each column should contain "Data"
- And the data for the first row should be "Data1" and "Data2"
+ Then the data for row "2" should be "Data1" and "Data2"
+ And the data for row "3" should be "Data3" and "Data4"
+ And the table should have "3" rows
+ And row "2" should have "2" columns
+ And the data for the second row should be "Data1" and "Data2"
And the data for the last row should be "Data3" and "Data4"
Scenario: Retrieve data from a table using a row header
@@ -44,7 +43,7 @@ Feature: Table
Scenario: Retrieve data from a table using a column header
When I retrieve a table element
- Then the data for column "Data2" and row "2" should be "Data4"
+ Then the data for column "Header" and row "3" should be "Data4"
Scenario: Retrieve data from a table with a thead using a column header
When I retrieve a table with thead element
@@ -56,11 +55,11 @@ Feature: Table
Scenario: Retrieve data from a table using a partial column header
When I retrieve a table element
- Then the data for column "ata2" and row "2" should be "Data4"
+ Then the data for column "eader" and row "3" should be "Data4"
Scenario: Retrieve data from a table using both headers
When I retrieve a table element
- Then the data for row "Data3" and column "Data2" should be "Data4"
+ Then the data for row "Data3" and column "eader" should be "Data4"
Scenario: Retrieve data from a table with an incorrect row header
When I retrieve a table element
@@ -76,7 +75,7 @@ Feature: Table
Scenario Outline: Locating table cells on the Page
When I retrieve a table element by "<search_by>"
- Then the data for row "1" should be "Data1" and "Data2"
+ Then the data for row "2" should be "Data1" and "Data2"
Scenarios:
| search_by |
@@ -89,15 +88,15 @@ Feature: Table
@selenium_only
Scenario Outline: Locating table cells on the Page
When I retrieve a table element by "<search_by>"
- Then the data for row "1" should be "Data1" and "Data2"
+ Then the data for row "2" should be "Data1" and "Data2"
Scenarios:
| search_by |
| css |
Scenario Outline: Locating table using multiple parameters
When I retrieve a table element by "<param1>" and "<param2>"
- Then the data for row "1" should be "Data1" and "Data2"
+ Then the data for row "2" should be "Data1" and "Data2"
Scenarios:
| param1 | param2 |
@@ -106,7 +105,7 @@ Feature: Table
Scenario: Finding a table dynamically
When I retrieve a table element while the script is executing
- And the data for row "1" should be "Data1" and "Data2"
+ And the data for row "2" should be "Data1" and "Data2"
@watir_only
Scenario: Finding an existing table

0 comments on commit 0aa3812

Please sign in to comment.