<small id='2xPq6'></small><noframes id='2xPq6'>

  • <i id='2xPq6'><tr id='2xPq6'><dt id='2xPq6'><q id='2xPq6'><span id='2xPq6'><b id='2xPq6'><form id='2xPq6'><ins id='2xPq6'></ins><ul id='2xPq6'></ul><sub id='2xPq6'></sub></form><legend id='2xPq6'></legend><bdo id='2xPq6'><pre id='2xPq6'><center id='2xPq6'></center></pre></bdo></b><th id='2xPq6'></th></span></q></dt></tr></i><div id='2xPq6'><tfoot id='2xPq6'></tfoot><dl id='2xPq6'><fieldset id='2xPq6'></fieldset></dl></div>

      <tfoot id='2xPq6'></tfoot>
      1. <legend id='2xPq6'><style id='2xPq6'><dir id='2xPq6'><q id='2xPq6'></q></dir></style></legend>
        • <bdo id='2xPq6'></bdo><ul id='2xPq6'></ul>

        如何用量角器或硒测试@media print?

        时间:2023-09-06
          <tbody id='h2kai'></tbody>

          <small id='h2kai'></small><noframes id='h2kai'>

            1. <legend id='h2kai'><style id='h2kai'><dir id='h2kai'><q id='h2kai'></q></dir></style></legend>
              <tfoot id='h2kai'></tfoot>
                <bdo id='h2kai'></bdo><ul id='h2kai'></ul>
                <i id='h2kai'><tr id='h2kai'><dt id='h2kai'><q id='h2kai'><span id='h2kai'><b id='h2kai'><form id='h2kai'><ins id='h2kai'></ins><ul id='h2kai'></ul><sub id='h2kai'></sub></form><legend id='h2kai'></legend><bdo id='h2kai'><pre id='h2kai'><center id='h2kai'></center></pre></bdo></b><th id='h2kai'></th></span></q></dt></tr></i><div id='h2kai'><tfoot id='h2kai'></tfoot><dl id='h2kai'><fieldset id='h2kai'></fieldset></dl></div>

                • 本文介绍了如何用量角器或硒测试@media print?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我已经在我的网站上实现了打印功能,我想通过量角器/硒对其进行测试.

                  I've implemented an print functionallity at my site, and I would like to test it via protractor / selenium.

                  在测试期间有什么方法可以应用" @media print 下的样式?

                  There is any method to "apply" the styles that are under @media print during the test?

                  我只看到了一个相关的问题,但它没有任何好的答案.

                  I saw only one relevant question, but it without any good answer.

                  例如在那个示例中,我希望 #hidden div 将在测试期间显示.

                  For example at that sample I would like to the #hidden div will be shown during the test.

                  .print-only {
                    display: none;
                  }
                  
                  @media print {
                    .print-only {
                      display: block;
                    }
                  }

                  <div id="hidden" class="print-only">Will be shown when printing</div>

                  推荐答案

                  我发现的一个选项是将所有打印" css 拆分为一个单独的文件,并通过 link 加载它带有 media="print" 的标签.

                  One option that I've found is to split all the "print" css into a separate file, and load it via link tag with media="print".

                  <link rel="stylesheet" type="text/css" href="print.css" media="print">
                  

                  意思是根本不在大型css文件中使用媒体查询.

                  Meaning not to use media query inside large css file at all.

                  这样我可以在测试期间通过 executeScriptmedia="print" 属性更改为 all.

                  That way will allow me to change the media="print" attribute during test to all via executeScript.

                  希望对某人有所帮助.

                  这篇关于如何用量角器或硒测试@media print?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:从 testcafe 中打开的第 N 个模式中选择 OK 按钮 下一篇:发现元素可见后无法使用递归定位元素

                  相关文章

                  最新文章

                  1. <tfoot id='XVJYq'></tfoot>

                      • <bdo id='XVJYq'></bdo><ul id='XVJYq'></ul>

                      <small id='XVJYq'></small><noframes id='XVJYq'>

                      <legend id='XVJYq'><style id='XVJYq'><dir id='XVJYq'><q id='XVJYq'></q></dir></style></legend>
                      <i id='XVJYq'><tr id='XVJYq'><dt id='XVJYq'><q id='XVJYq'><span id='XVJYq'><b id='XVJYq'><form id='XVJYq'><ins id='XVJYq'></ins><ul id='XVJYq'></ul><sub id='XVJYq'></sub></form><legend id='XVJYq'></legend><bdo id='XVJYq'><pre id='XVJYq'><center id='XVJYq'></center></pre></bdo></b><th id='XVJYq'></th></span></q></dt></tr></i><div id='XVJYq'><tfoot id='XVJYq'></tfoot><dl id='XVJYq'><fieldset id='XVJYq'></fieldset></dl></div>