Feature: Validations: Test Xpath namespaces and xpaths
{
"directory": "./test"
}
Given
xPath namespace is '{ "new": "TEst" }'
0s
{
"xml": "<root xmlns:h=\"http://www.w3.org/TR/html4/\"\nxmlns:f=\"https://www.w3schools.com/furniture\">\n\n<h:table>\n <h:tr>\n <h:td>Apples</h:td>\n <h:td>Bananas</h:td>\n </h:tr>\n</h:table>\n\n<f:table>\n <f:name>African Coffee Table</f:name>\n <f:width>80</f:width>\n <f:length>120</f:length>\n</f:table>\n\n</root>\n\n"
}
Given
xPath namespace is
0s
{
"h2": "http://www.w3.org/TR/html4/"
}
And
add xPath namespace "l" = "https://www.w3schools.com/furniture"
00:00:00.001
{
"lastRun": "Apples"
}
Then
it is equal to "Apples"
00:00:00.001
Then
it is written to file "expected.out"
0s
{
"directory": "./test"
}
And
add xPath namespace "h2" = "http://www.w3.org/TR/html4/"
0s
{
"xml": "<root xmlns:h=\"http://www.w3.org/TR/html4/\"\nxmlns:f=\"https://www.w3schools.com/furniture\">\n\n<h:table>\n <h:tr>\n <h:td>Apples</h:td>\n <h:td>Bananas</h:td>\n </h:tr>\n</h:table>\n\n<f:table>\n <f:name>African Coffee Table</f:name>\n <f:width>80</f:width>\n <f:length>120</f:length>\n</f:table>\n\n</root>\n\n"
}
{
"lastRun": "Apples"
}
Then
it is equal to "Apples"
0s
{
"directory": "./test"
}
{
"xml": "<root xmlns:h=\"http://www.w3.org/TR/html4/\"\nxmlns:f=\"https://www.w3schools.com/furniture\">\n\n<h:table>\n <h:tr>\n <h:td>Apples</h:td>\n <h:td>Bananas</h:td>\n </h:tr>\n</h:table>\n\n<f:table>\n <f:name>African Coffee Table</f:name>\n <f:width>80</f:width>\n <f:length>120</f:length>\n</f:table>\n\n</root>\n\n"
}
Given
xPath namespace is '{ "h2": "http://www.w3.org/TR/html4/" }'
0s
{
"lastRun": "Apples"
}
Then
it is equal to "Apples"
0s
{
"directory": "./test"
}
{
"xml": "<hello>There</hello>"
}
{
"lastRun": "There"
}
Then
it is equal to "There"
00:00:00.001