On Sun, May 24, 2015 at 10:08 PM, 章浩 jason.daurus@gmail.com wrote:
Hi Singh,
Recently I am working on templates of `tbl_column_definitions.lib.php`, and I need some help from you.
I met a problem on the unit test:
[image: Inline image 1]
And here is the test code raise the problem:
[image: Inline image 2]
The failure is caused by the format of HTML, which will not cause any side effects for user interface. So what should I do to handle this kind of error? Merging spaces in a HTML tag may help, but it seems difficult to distinguish a special case:
*Before trimming:*
<script>someScript(); // anotherScript();</script>
*After trimming:*
<script>someScript(); // anotherScript();</script>
It's obvious that it will cause some Javascripts being commented. Then I figured out a second solution: modify the test scripts and let it pass. This is a "palliative" solution, we have to spend plenty of time to fix this kind of problems.
Maybe we could use a more effective way to test front-end components (templates, pages, etc) in the future, though I haven’t figure out how to achieve this goal yet.
Could you give me some suggestions about this?
Hi devs,
I share Jason's confusion above and doubt the usefulness of unit tests that are just asserting for static HTML strings in a dynamic HTML output and one that will keep evolving with course of development.
Also I wonder about its importance as we move to template system[0], opinions are welcome for possible better ways of doing it. Maybe we can just test for valid input data getting used by the template and some important key words but not HTML tags[1]
[0] https://github.com/phpmyadmin/phpmyadmin/pull/1642#discussion_r28551465 [1] http://stackoverflow.com/questions/3429218/unit-tests-for-html-output
Best regards,
Jason
-- Atul Pratap Singh
On 25-May-2015 2:48 am, "Atul Pratap Singh" atulpratapsingh05@gmail.com wrote:
On Sun, May 24, 2015 at 10:08 PM, 章浩 jason.daurus@gmail.com wrote:
Hi Singh,
Recently I am working on templates of `tbl_column_definitions.lib.php`,
and I need some help from you.
I met a problem on the unit test:
And here is the test code raise the problem:
The failure is caused by the format of HTML, which will not cause any
side effects for user interface. So what should I do to handle this kind of error? Merging spaces in a HTML tag may help, but it seems difficult to distinguish a special case:
Before trimming:
<script>someScript(); // anotherScript();</script>
After trimming:
<script>someScript(); // anotherScript();</script>
It's obvious that it will cause some Javascripts being commented. Then I
figured out a second solution: modify the test scripts and let it pass. This is a "palliative" solution, we have to spend plenty of time to fix this kind of problems.
Maybe we could use a more effective way to test front-end components
(templates, pages, etc) in the future, though I haven’t figure out how to achieve this goal yet.
Could you give me some suggestions about this?
Hi devs,
I share Jason's confusion above and doubt the usefulness of unit tests
that are just asserting for static HTML strings in a dynamic HTML output and one that will keep evolving with course of development.
Also I wonder about its importance as we move to template system[0],
opinions are welcome for possible better ways of doing it. Maybe we can just test for valid input data getting used by the template and some important key words but not HTML tags[1]
I also think that asserting HTML tags is of less use and we should test only few keywords. UI should be tested using selenium.
[0]
https://github.com/phpmyadmin/phpmyadmin/pull/1642#discussion_r28551465
[1] http://stackoverflow.com/questions/3429218/unit-tests-for-html-output
Best regards,
Jason
-- Atul Pratap Singh
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Phpmyadmin-devel mailing list Phpmyadmin-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel
On 5/24/15 5:18 PM, Atul Pratap Singh wrote:
On Sun, May 24, 2015 at 10:08 PM, 章浩 <jason.daurus@gmail.com mailto:jason.daurus@gmail.com> wrote:
Hi Singh, Recently I am working on templates of `tbl_column_definitions.lib.php`, and I need some help from you. I met a problem on the unit test: Inline image 1 And here is the test code raise the problem: Inline image 2 The failure is caused by the format of HTML, which will not cause any side effects for user interface. So what should I do to handle this kind of error? Merging spaces in a HTML tag may help, but it seems difficult to distinguish a special case: /Before trimming:/ <script>someScript(); // anotherScript();</script> /After trimming:/ <script>someScript(); // anotherScript();</script> It's obvious that it will cause some Javascripts being commented. Then I figured out a second solution: modify the test scripts and let it pass. This is a "palliative" solution, we have to spend plenty of time to fix this kind of problems. Maybe we could use a more effective way to test front-end components (templates, pages, etc) in the future, though I haven’t figure out how to achieve this goal yet. Could you give me some suggestions about this?
Hi devs,
I share Jason's confusion above and doubt the usefulness of unit tests that are just asserting for static HTML strings in a dynamic HTML output and one that will keep evolving with course of development.
Also I wonder about its importance as we move to template system[0], opinions are welcome for possible better ways of doing it. Maybe we can just test for valid input data getting used by the template and some important key words but not HTML tags[1]
I agree that this seems difficult to maintain and of limited use. I don't really have any suggestions on how to move forward; I think it's important to do some sort of tests. Your suggestion of testing for valid data and keywords seems like a good way to proceed to me.
[0] https://github.com/phpmyadmin/phpmyadmin/pull/1642#discussion_r28551465 [1] http://stackoverflow.com/questions/3429218/unit-tests-for-html-output
Best regards, Jason
-- Atul Pratap Singh
One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
Phpmyadmin-devel mailing list Phpmyadmin-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel
Isaac Bennetch a écrit :
On 5/24/15 5:18 PM, Atul Pratap Singh wrote:
On Sun, May 24, 2015 at 10:08 PM, 章浩 <jason.daurus@gmail.com mailto:jason.daurus@gmail.com> wrote:
Hi Singh, Recently I am working on templates of `tbl_column_definitions.lib.php`, and I need some help from you. I met a problem on the unit test: Inline image 1 And here is the test code raise the problem: Inline image 2 The failure is caused by the format of HTML, which will not cause any side effects for user interface. So what should I do to handle this kind of error? Merging spaces in a HTML tag may help, but it seems difficult to distinguish a special case: /Before trimming:/ <script>someScript(); // anotherScript();</script> /After trimming:/ <script>someScript(); // anotherScript();</script> It's obvious that it will cause some Javascripts being commented. Then I figured out a second solution: modify the test scripts and let it pass. This is a "palliative" solution, we have to spend plenty of time to fix this kind of problems. Maybe we could use a more effective way to test front-end components (templates, pages, etc) in the future, though I haven’t figure out how to achieve this goal yet. Could you give me some suggestions about this?
Hi devs,
I share Jason's confusion above and doubt the usefulness of unit tests that are just asserting for static HTML strings in a dynamic HTML output and one that will keep evolving with course of development.
Also I wonder about its importance as we move to template system[0], opinions are welcome for possible better ways of doing it. Maybe we can just test for valid input data getting used by the template and some important key words but not HTML tags[1]
I agree that this seems difficult to maintain and of limited use. I don't really have any suggestions on how to move forward; I think it's important to do some sort of tests. Your suggestion of testing for valid data and keywords seems like a good way to proceed to me.
[0] https://github.com/phpmyadmin/phpmyadmin/pull/1642#discussion_r28551465 [1] http://stackoverflow.com/questions/3429218/unit-tests-for-html-output
Best regards, Jason
Hi, I added an item about this here: https://wiki.phpmyadmin.net/pma/2015-06_Meeting
I have hit a few cases where a unit test failed due to a change in HTML output, and this helped me spot a bug. However these cases have been rare.
Hi
Dne Mon, 25 May 2015 02:48:02 +0530 Atul Pratap Singh atulpratapsingh05@gmail.com napsal(a):
I share Jason's confusion above and doubt the usefulness of unit tests that are just asserting for static HTML strings in a dynamic HTML output and one that will keep evolving with course of development.
Also I wonder about its importance as we move to template system[0], opinions are welcome for possible better ways of doing it. Maybe we can just test for valid input data getting used by the template and some important key words but not HTML tags[1]
I think the most important thing in these tests is that they run without error. We might also add some extra validation of the output (like being valid HTML and possibly check for some words).