How to enqueue only certain commands in cypress? - cypress

I want cypress to only enqueue and start certain commands, for example, ['visit', 'get'] could be the only ones to enqueue. And any other cypress command should be ignored. Is there a way I can implement that?

Related

If I run multiple test cases together, do I need to clear previous state or will Angular do it automatically?

I have multiple test cases covering different components and in different specs. Each of them run successfully but when I run them together, some of them randomly fail, some for weird reasons like a css-selector isn't found
let routerElement = contentComponentElement.querySelector("router-outlet");
expect(routerElement).toBeTruthy(); //fails sometimes
Could it be possible that because I am running them together, a test case is picking residue or left-over state of the previous test case? Is it possible to clear all the previous data/html etc. before running a new test case?
The issue was some of the test cases used Observables and I wasn't waiting for the Observables to finish before moving to the next test case. I started calling done for such test cases and now things are in order.

Run Teamcity configuration N times

In the set of my TeamCity configurations, I decided to make something like an aging test*. And run a single configuration for a 100 times.
Can I make in a few simple clicks?
*aging test - test that is showing, that due time/aging, results will not be changed.
As of now, this is not possible from UI. If you run one build configuration few times without any changes, they will be merged and only 1 will be executed. If you want to run 100, you have to trigger them one by one, after the previous one finished executing.
But the better solution is to trigger builds from script using REST API (for more details see the documentation here), if builds have different values in custom parameters they all will be put in the queue.
HOW: Define a dummy custom parameter, and trigger the build from script within a loop. Pass the value of iterating variable as parameter value. So, TeamCity will think those are different builds and execute all of them.

Run non-blocking series of jobs

A certain number of jobs needs to be executed in a sequence, such that result of one job is input to another. There's also a loop in one part of job chain. Currently, I'm running this sequency using wait for completition, but I'm going to start this sequence from web service, so I don't want to get stuck waiting for response. I wan't to start the sequence and return.
How can I do that, considering that job's depend on each other?
The typical approach I follow is to use Oozie work flow to chain the sequence of jobs with passing the dependent inputs to them accordingly.
I used a shell script to invoke the oozie job .
I am not sure about the loops within the oozie workflow. but the below link speaks about the way to implement loops within the workflow.Hope it might help you.
http://zapone.org/bernadette/2015/01/05/how-to-loop-in-oozie-using-sub-workflow/
Apart from this the JobControl class is also a good option if the jobs need to be in sequence and it requires less efforts to implement.It would be easy to do loop since it would be fully done with Java code.
http://gandhigeet.blogspot.com/2012/12/hadoop-mapreduce-chaining.html
https://cloudcelebrity.wordpress.com/2012/03/30/how-to-chain-multiple-mapreduce-jobs-in-hadoop/

Using Capybara and Rspec, how do I get more verbose logging?

Currently my Capybara/Selenium/RSpec script runs with no output. It simply sit there and waits until all scenarios have finished. I want more verbose output.
To start, I want a log at the beginning of each scenario, so that I know which scenarios are running.
Then I want the result of each scenario to be logged, pass or fail.
Can I do this manually with before/after hooks? Is there an option I can pass to the "rspec" command? Or maybe some other solution?

Do you need to wait for completion on a TPL Dataflow DataflowBlock.NullTarget<T>

Questions like this one:
TPL Dataflow, how to forward items to only one specific target block among many linked target blocks?
propose using the DataflowBlock.NullTarget{T} to discard items from a pipeline, e.g.
forwarder.LinkTo(DataflowBlock.NullTarget<SomeType>());
However, if you use NullTarget like this, how do you wait for Completion? Would it not be better to create a discard block:
ITargetBlock<SomeType> discard = DataflowBlock.NullTarget<SomeType>();
forwarder.LinkTo(discard);
and wait for completion on this? i.e.
discard.Completion.Wait()
Or do you not need to wait for completion of a "NullTarget" block, i.e. is it simply throw away and forget?
This isn't documented, but based on my tests, the Completion of a NullTarget will never complete, even after you Complete() or Fault() it.
What this means is that you can't wait on the completion of NullTarget blocks, because the waiting would never end.

Resources