I marked test that took extremely long time to check with a special tag. I tried add tag to the ignored list, but scalacheck runs it regardless.
So I'd like to list all tests with specific tag or make a dry-run to see if tag exclusion option (-l) has any effect.
How should I do it?
Related
I have a tracking Iframe that is deployed through a custom HTML tag and triggered on the window loaded event.
The src attribute takes several custom JS variables to populate certain parameters where available.
However, in production the src attribute is full of errors that aren't showing up in preview mode. There are no issues with the variables themselves, as they have all been unit tested extensively.
Below are (1) the tag config for the iFrame's src attribute as shown within GTM, (2) the html produced in preview/debug mode, and (3) the html that's actually being produced in production:
​
src="//servedby.flashtalking.com/container/14745;109435;11282;iframe/?ftXRef={{TransID Availability Test - Onetag}}&ftXValue={{Revenue Availability Test - Onetag}}&ftXType=FTXTYPE_VALUE&ftXName=FTXNAME_VALUE&ftXNumItems=FTXNUMITEMS_VALUE&ftXCurrency=FTXCURRENCY_VALUE&U1=U1_VALUE{{dataLayer Stations Output - Onetag}}{{Journey Date Output - Onetag}}{{Journey Ticket Type Output - Onetag}}&U8=U8_VALUE&U9=U9_VALUE&U10=U10_VALUE&U11=U11_VALUE&U12=U12_VALUE&U13=U13_VALUE&U14=U14_VALUE&U15=U15_VALUE&U16=U16_VALUE&U17=U17_VALUE&U18=U18_VALUE&U19=U19_VALUE&U20=U20_VALUE&ft_referrer={{Encoded Page URL}}&ns={{Referrer}}&cb={{Random Number}}"
https://servedby.flashtalking.com/container/14745;109435;11282;iframe/?ftXRef=2526968585&ftXValue=1.2&ftXType=FTXTYPE_VALUE&ftXName=FTXNAME_VALUE&ftXNumItems=FTXNUMITEMS_VALUE&ftXCurrency=FTXCURRENCY_VALUE&U1=U1_VALUE%26U2%3DU2_VALUE%26U3%3DU3_VALUE%26U4%3D28%2F12%2F19%26U5%3D%26U6%3DSDS%26U7%3DU7_VALUE&U8=U8_VALUE&U9=U9_VALUE&U10=U10_VALUE&U11=U11_VALUE&U12=U12_VALUE&U13=U13_VALUE&U14=U14_VALUE&U15=U15_VALUE&U16=U16_VALUE&U17=U17_VALUE&U18=U18_VALUE&U19=U19_VALUE&U20=U20_VALUE&ft_referrer=https%253A%252F%252Fwww.domain.co.uk%252Fbuytickets%252Fpaymentconfirmation.aspx&ns=https%3A%2F%2Fwww.domain.co.uk%2Fbuytickets%2Fpaymentconfirmation.aspx&cb=126603136
https://servedby.flashtalking.com/container/438;87804;9034;iframe/?ftXRef=2526968585&ftXValue=1.2&U1=paymentconfirmation&U3=1&U4=01000&U7=28/12/19&U9=BIRMINGHAM%20NEW%20STREET&U10=BIRMINGHAM%20SNOW%20HILL&ft_referrer=https%3A//www.domain.co.uk/buytickets/paymentconfirmation.aspx&ns=https%3A//www.domain.co.uk/buytickets/paymentconfirmation.aspx&cb=473400.6608119874
​​As you can see, the section in (2) in bold/italics is being removed entirely in production, despite the fact that these parameters aren't configured to be populated or modified by any variables. Similarly, parameters U9 and U10 are being populated seemingly from nothing - they aren't set to be populated by any variables.
Those parameters that are configured to be populated by custom variables aren't working properly - the values shown in production are either absent or else don't match the results given either in debug/preview or in unit testing, which suggests the problem is with GTM itself.
Are you sure that these are the same tag? Looking at the top tag it starts
/container/14745;109435;11282
and the bottom tag starts
/container/438;87804;9034
To me, the tags seem so completely different that I don't believe they're the same. GTM may do many things, but it doesn't randomly change your code! I've never seen it remove variables, or add them in, or change strings, it wouldn't have the ability to. Custom HTML tags are literally written 'as is' into the GTM.js file, with the exception of variables being replaced with macros.
If you've recently updated the tag then other reasons you're not seeing the changes may be:
You're looking at a cached version of GTM, in which case empty your cache, refresh the page and that should sort it.
You're working in and previewing changes that haven't been published, so won't show on the live site; if you publish the changes that should work.
If neither of those work then it would be good if you could share a link to the site so I can investigate!
Lets say I want to scrape the Neo4j RefCard found at: https://neo4j.com/docs/cypher-refcard/current/
And I would like to fetch a 'code' example along with its styling. Here's my target. Notice that it has CSS treatment (font, color...):
...so in Neo4j I call the apoc.load.html procedure as shown here, and you can see it's no problem finding the content:
It returns a map with three keys: tagName, attributes, and text.
The text is the issue for me. It's stripped of all styling. I would like for it to let me know more about the styling of the different parts of this text.
The actual HTML in the webpage looks like following image with all of these span class tags: cm-string, cm-node, cm-atom, etc. Note that this was not generated by Neo4j's apoc.load.html procedure. It came straight from my Chrome browser's inspect console.
I don't need the actual fonts and colors, just the tag names.
I can seen in the documentation that there is an optional config map you can supply, but there's no explanation for what can be configured there. It would be lovely if I could configure it to return, say, HTML rather than text.
The library that Neo4j uses for CSS selection here is jsoup.
So I am hoping to not strip the <span> tags, or otherwise, extract their class names for each segment of text.
Could you not generate the HTML yourself from the properties in your object? It looks they are all span tags with 3 different classes depending on whether your using the property name, property value, or property delimiter?
That is probably how they are generating the HTML themselves.
Okay, two years later I revisited this question I posted, and did find a solution. I'll keep it short.
The APOC procedure CALL apoc.load.html is using the scraping library Jsoup, which is not a full-fledged browser. When it visits a page it reads the html sent by the server but ignores any javascript. As a result, if a page uses javascript for inserting content or even just formatting the content, then Jsoup will miss the html that the javascript would have generated had it run.
So I have just tried out the service at prerender.com. It's simple to use. You send it a URL, it takes your url as an argument and fetches that page itself and executes the page's javascript as it does. It returns the final result as static HTML.
So if I just call prerender.com with apoc.load.html then the Jsoup library will simply ask for the html and this time it will get the fully rendered html. :)
You can try the following two queries and see the difference pre-rendering makes. The span tags in this page are rendered only by javascript. So if we call it asking for its span tags without pre-rendering we get nothing returned.
CALL apoc.load.html("https://neo4j.com/docs/cypher-refcard/current/", {target:".listingblock pre:contains(age: 38) span"}) YIELD value
UNWIND value.target AS spantags
RETURN spantags
...but if we call it via the prender.com website, you will get a bunch of span tags and their content.
CALL apoc.load.html("https://service.prerender.cloud/https://neo4j.com/docs/cypher-refcard/current/", {target:".listingblock pre:contains(age: 38) span"}) YIELD value
UNWIND value.target AS spantags
RETURN spantags
I have been using a central CSS file to build my site and have added to and modified it over time. I use cloudflare which caches CSS files every few hours, so to avoid this I change the number on the end of the file name each time and update it in my header template. This worked fine for months on two different servers.
But just recently it has decided not to allow this. If I change the CSS's file name and reference link, the CSS will not load. If I set it back to what it was before (site_main61.css) then it works just fine. I've even tried using different characters than increment numbers at the end and still end up with the same result.
This started happening out of the blue; no changes had been made to the server. Could this be a problem with Cloudflare? Something else?
I can provide more details if needed, but I can't think of anything that would be relevant right now.
The problem is not related to forgetting to update the link in html. I've tested this countless times to be sure.
You can add a query string the to end of the file name. It will be cached as a separate file, but it will be the same filename. It's basically a forced recache for the file. Just go to the link in the HTML and add something like this:
<link href="path/to/file/site_main61.css?version=1" ... />
This will work with most caching systems and you no longer have to change the file name.
I have several large CSS files and making a change can sometimes take a few minutes just to find the right selector to change. I would like it if there was a nice ModX editor for CSS, but I haven't been able to find one. I am willing to settle for splitting up my files into parts, as long as my site still renders. Can I do that and how? If there is a nice editor (plugin?) instead, where can I find one?
I guess the real question is what kind of parts are acceptable for you. If you follow this question, you can begin the process of allowing ModX to manage your CSS. Once this happens, your options open considerably. Your CSS editing will then become easier and less time consuming depending on your level of expertise with ModX. This answer will be pretty simple, as it will show simply how to add a given selector as a resource. Other further development can be intuited from here, though.
CSS as a Resource
Once your CSS is being managed as a Resource (which takes about 15 minutes), you may utilize Templates, Template Variables, Chunks, Snippets and Plugins. Thisis actually pretty amazing, but setup can be a bit of a pain. You will basically be investing some time to save a lot of time in the future. The next logical step is split your Selectors accordingly, but you don't want to break what currently works. Having a fluid understanding of the getResources addon will be crucial to further development.
How to do it:
1. Create a new chunk
Click the Elements tab, and click "New Chunk". Name it "css-selector". Set the content to:
[[+pagetitle]] {[[+content]]}
It's as simple as that. Don't forget to click "Save"! This will let you set a Selector as a resource. It will use the title for the selector and content for the rules. You can forget about using those braces any more. Your new chunk will handle those from now on.
2. Adjusting your Template
Now, we just have to convince the template that it nows how to read parts, as well as not forget the whole. Open your CSS Stylesheet template (the one that says [[*content]] for its content). Adjust the code so that it has the following:
[[!getResources?
&parent=`[[*id]]`
&depth=`1`
&tpl=`css-selector`
&includeContent=`1`
&sortby=`menuindex`
&sortdir=`ASC`
&limit=`99`
]]
[[*content]]
Again, click "Save". Let me explain the Template real quick. If you have child, they'll get rendered first depending on their menu index. Further, it will render the contents of the document that are not children afterward. This will allow you to only make new resources for your most important selectors, while keeping the stuff that will never change in the main resource.
3. Create a new Template
This is so that your selectors don't do anything funny and just render the content. Create a new Template named "CSS Selector". Set its content to:
[[*content]]
4. Create a new Resource
Create a new Resource. Set the title to the selector for the css statement you want to manage. Then set the content to the rules without the braces. For instance, if your css statement is: div#header .logo {border:0;}, you'll set the title to div#header .logo and the content to border:0;. Set the resource alias to whatever you want. I use numbers for each one. Set the template to your new "CSS Selector". Important Now, set the Parent Document to your Stylesheet. Click Save.
5. Testing the Stylesheet
First, Right-click your new resource and choose "View Resource". This will just make sure that the statement was rendered correctly. It should simply say your rule in CSS format.
Next, Right-Click the Stylesheet resource and choose "View Resource". You should see the Selector at the top and all of the other rules below it.
Final Considerations
Observations
You'll notice that your child resources do not have to be changed to "CSS" for Document Type. Only the parent stylesheet has to be. This allows for some neat stuff as your expertise with ModX grows.
You can change the order of rules by simply changing the menu index of them.
The number of rules that can be done this way is based on the &limit variable in the getResources statement in your template. &limit applies to each stylesheet, so in this example you have 99 statements per stylesheet that may be separate resources.
A Note on Server Load
This will place load on the server as the number of resources goes up. For development, keep the "do not cache flag" (!) on your getResources statement. Once you are done, remove the exclamation mark and let it all be cached. This will save a ton of load.
Further Development
I added an isEnabled template variable to mine so I can turn on and off each rule as I pleased.
You may possibly begin to manage your CSS on the front-end utilizing FormIt.
Custom Manager Pages may even be a better option for you.
Further abstraction might allow you to create Groupings of statements for even further organization.
Is there a way in code to determine if a Web control contains server blocks (other than, for example, parsing out the file, grabbing the contents of the tag, and scanning for <% ... %>)?
My reason for wanting this is because I have a lot of old Web forms that were designed without any regard whatsoever to HTML conformance. The header control (which is included on every page but is inside the body tag) contains the link tag referencing the site's main stylesheet. As long as the page's head tag does not contain server blocks, I can programmatically insert the link tag into Page.Controls.OfType(Of HtmlHead).First(), then set the visibility of the "bad" link tag to false.
Again, this is all legacy stuff (it's in 3.5 now, but most was written in the .NET 1.1 days), so changing everything over to use a master page is something for which I simply do not have the time and budget. Regardless, it would be nice to see the pages come up with the stylesheet pre-loaded, rather than having the browser begin rendering with no styling, then applying the stylesheet once it reaches the reference to it in the body.
Seems like a silly work around but could you change the name of your CSS file so that when the legacy code goes to load, it can't find it?
Although Mufasa entered his response as a comment, this question has been sitting unresolved too long. Therefore, I will surmise that the only solution is his -- to wrap it in a try/catch black.