This test ensures we can get at a page's HTML source code.

!define HTML { {{{
<!DOCTYPE html><html><head><title>Start Page Title</title>
</head><body>
<input name="remove" type="button" value="Remove">
</body></html>}}} }

!2 No extension

|script      |mock xml server setup|
|add response|${HTML}              |
|$url=       |get mock server url  |

|script  |browser test                                                                        |
|open    |$url                                                                                |
|show    |page source                                                                         |
|show    |save page source                                                                    |
|$source=|page source                                                                         |
|check   |save page source|=~/<a href="files/.*?\.html" target="_blank">FitNesseMock.html</a>/|

|script|compare fixture                                                    |
|check |count differences between (ignore whitespace)|${HTML}|and|$source|0|

|script|mock xml server setup|
|stop                        |

!2 HTML extension

|script      |mock xml server setup|/test.html|
|add response|${HTML}                         |
|$url=       |get mock server url             |

|script|browser test                                                                |
|open  |$url                                                                        |
|check |save page source|=~/<a href="files/.*?\.html" target="_blank">test.html</a>/|

|script|mock xml server setup|/test.html|
|stop                                   |

!2 No file name

|script      |mock xml server setup|/test/|
|add response|${HTML}                     |
|$url=       |get mock server url         |

|script|browser test                                                                      |
|open  |$url                                                                              |
|check |save page source|=~/<a href="files/.*?\.html" target="_blank">pageSource.html</a>/|

|script|mock xml server setup|/test/|
|stop                               |

!2 Query params?

|script      |mock xml server setup|/test|
|add response|${HTML}                    |
|$url=       |get mock server url        |

|script|browser test                                                                |
|open  |$url?hallo=1&yes=no                                                         |
|check |save page source|=~/<a href="files/.*?\.html" target="_blank">test.html</a>/|

|script|mock xml server setup|/test|
|stop                              |
