Couldn't understand RSpec expectation error - cucumber

I am getting this ExpectationNotMetError in my cucumber/watir test,
How to tell the difference?
RSpec::Expectations::ExpectationNotMetError:
expected: "Limits as usual \u0393\u00C7\u00F6 Limits in perspective /\u256B\u00C6\u256B\u00E6\u256B\u00F2\u256B\u00A3\u256B\u00F2\u256B\u00AC\u256B\u00D6\u256B\u00F6 \u256B\u2310\u256B\u00A3 \u256B\u00C9\u256B\u00D6\u256B\u00A3\u256B\u00D6\u256B\u00F6 \u256B\u00BA\u256B\u00F1\u256B\u00D6\u256B\u00FF\u256B\u00F2\u256B\u00A3\u256B\u00D6\u256B\u00E1\u256B\u00F6 \u0393\u00C7\u00F6 \u256B\u20A7\u256B\u00E6\u256B\u00FF \u256B\u20A7\u256B\u00E6\u256B\u00AC\u256B\u00D6 \u256B\u00F6\u256B\u00BA\u256B\u00E6\u256B\u00BF\u256B\u00F2\u256B\u00AC"
got: "Limits as usual \u2014 Limits in perspective /\u05D2\u05D1\u05D5\u05DC\u05D5\u05EA\u05D9\u05D4 \u05E9\u05DC \u05D0\u05D9\u05DC\u05D9\u05D4 \u05E7\u05E4\u05D9\u05D8\u05D5\u05DC\u05D9\u05E0\u05D4 \u2014 \u05DE\u05D1\u05D8 \u05DE\u05D1\u05EA\u05D9 \u05D4\u05E7\u05D1\u05E8\u05D5\u05EA"

The string you are testing contains "\u 2014" but your test expects the string not to contain that. As a result, the test is failing on the expectation.
To simplify:
expected: "............" got "......2014......"

Related

Passing data from one step to another using screenplay ( e.g. When -> Then )

Using serenity-js, with cucumber and screenplay, i can't get to pass data from one step to another. E.g. : a "When" step defined by a pretty user.attempsTo() that simply calls a webservice, and a "Then" step that should simply checks the response of the webservice. "TakeNote" forgets the data of the previous step ( as i could see, even surprising) and "LastResponse" context might be lost also...
I guess there is a simple way to store an object (as a Question maybe) in one Activity of the "When" step, and get back this object in an Activity of the "Then" step.
Without Serenity, i would use a World object that is clearly a simple way to do the job, but i'm sure there a Serenity pretty way to do the trick.
Thank you.
Bruno
I tried to pass the object with LastResponse, with TakeNotes. But the object seems to be lost.
I found what was wrong (answering to myself).
user.attempsTo() is actually processed prior to the next step only if a resolution of the promise is asked, so if preceded by return, or await, or if it is declared as an implicit return using arrow function like this ( user :Actor) => attempsTo(...) ).
Without the promise resolution, interactions are not executed in the described sequence, and this is really no good.
The symptom for a bad code is that the interactions are not logged in their steps, but in step further. Hope this helps.

How to get a certain (e.g. second or third) mention sent in a message

I've been trying to make a ship command that can either ship the author of the message with a mentioned user, or ship two mentioned users. I can get the 1st mention in a message but I have no idea on how to get the 2nd or even third mention in a message. I tried using:
message.mentions.users.first(2)
splitting the args then slicing them so only the second mention is avalaible, but this gives an "undefined" error when I try to get the username.
Could someone give me a script on exactly how to do it since I can't really get the hang of this
According to the documentation message.mentions.users yields a Collection. So you can just iterate over this collection or convert it to an array and then access the required index:
const userArray = message.mentions.users.array();
console.log(userArray[yourDesiredIndex]);

how to do Gremlin contain search for both number and string

Neptune 1.0.2.1 + Gremlin + nodejs.
I have a vertext and property, e.g. Vertex - Device, property - Test, the Test property could store different type of data, e.g. number and string
Vertex 1 - Test = ['ABCD','xyz']
Vertex 2 - Test = [123,'XYZ']
I want to do a 'containing' search, e.g. Test=A, or Test=123 regardless the datatype.
I was trying
queryText = 'BC' //this throw error
or queryText = 123 //this actually works
//I expect both case should hit the result.
g.V().hasLabel('Device').or(__.has('Test', parseFloat(queryText)), __.has('Test', textP.containing(queryText)));
but get 'InternalFailureException\' error
Is it possible I can write a single query regardless the datatype?
if not possible, or at least make textP.containing work with multiple query assuming I know the datatype? right now the containing search throw error if the property contains number
It looks like you have the closing bracket in the wrong place inside the or() step. You need to close the first has step before the comma.
In your example
g.V().hasLabel('Device').or(__.has('Test', parseFloat(queryText), __.has('Test', textP.containing(queryText))));
Which should be
g.V().hasLabel('Device').or(__.has('Test', parseFloat(queryText)), __.has('Test', textP.containing(queryText)));
EDITED and UPDATED
With the corrected query and additional clarification about the data model containing different types for the same property key, I was able to reproduce what you are seeing. However, the same behavior can be seen using TinkerGraph as well as Neptune. The error message generated is is a little different but the meaning is the same. Given the fact that TinkerGraph behaves the same way I am of the opinion that Neptune is behaving consistently with the "reference" implementation. That said, this raises a question as to whether the TextP predicates should be smarter and check the type of the property before attempting the test.
gremlin> graph = TinkerGraph.open()
==>tinkergraph[vertices:0 edges:0]
gremlin> g = graph.traversal()
==>graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
gremlin> g.addV('test').property('x',12.5)
==>v[0]
gremlin> g.addV('test').property('x','ABCDEF')
==>v[2]
gremlin> g.V().hasLabel('test').or(has('x',12.3),has('x',TextP.containing('CDE')))
java.math.BigDecimal cannot be cast to java.lang.String
Type ':help' or ':h' for help.
Display stack trace? [yN]
ADDITIONAL UPDATE
I created a Jira issue so the Apache TinkerPop community can consider making a change to the TextP predicates.
https://issues.apache.org/jira/browse/TINKERPOP-2375

Get Outcome by Test Case ID

I'm at a loss with this one. What is the most direct way I can get the outcome of a test run associated with a test case (work item)?
Here is the API call for Get Results:
GET https://dev.azure.com/{organization}/{project}/_apis/test/Runs/{runId}/results/{testCaseResultId}?api-version=5.0
I would need the runId and the testCaseResultId.
I can get a list of test runs:
GET https://dev.azure.com/{organization}/{project}/_apis/test/runs?api-version=5.0
but this doesn't seem to have any association with test cases.
There isn't much to do with the Test Cases section of the API.
I must be missing something, it shouldn't be this hard to get a result of a test case?

Unmarshaller failure

I have to mrss feeds form which I'm getting the content via unmarshalling process. They look like to have the same structure, but in one case it is always returning null as 'mediaContent'. Can someone help what is the difference between the two feeds?
returns null:
http://smrss.neulion.com/u/nhl/mrss/sights-and-sounds/vod.xml
working correctly:
http://smrss.neulion.com/u/nhl/mrss/news/news_mrss.xml
At first glance seems that namespaces are different .. first one is http://search.yahoo.com/mrss, and the second is http://search.yahoo.com/mrss/. The second has a / at the end.

Resources