Can Behat tables be used to check multiple text labels - cucumber

Using Behat with mink and Drupal extensions.
I essentually have a page with multiple labels and I want to confirm the text of them all. I want to do this without having to enter something like.
Then I should see "Filter"
Is there a way to check all the text im expecting using Pystrings or Tables in a similar way they can be used to populate text fields:
And I fill in "Options" with:
Just thought it maybe easier to check it all at once rather than having to provide multiple steps
=====
Update:
After being provided some direction from dblack I used the following inside its own feature to test all labels that fall on the same page:
Note: I use the mink and UIBusinessSelector extensions
Also the 'login' is a custom function
Background: All scenarios require an admin login, then create a filter then confirm page labels
Given I login as an admin
When I go to the page "Product Filter"
And I click the "Add Filter Button"
Scenario Outline: Verifying page text
Then I should see "<ThisText>"
Examples:
| ThisText |
| Filter by SKUs |
| Filter by Package Name |
| Filter by Campaign Medium |
| Filter by Product Category |
| Filter by Product Selection |
| Filter by Product Holiday Experience |
| Filter by Product Star Rating |
| Filter by Product Destination |
| Filter by Product Duration |
| Filter by Product Supplier |
| Filter by Air Ex Point |
| Filter by Land Ex Point |
| Filter by Product departure |
| Filter by Ship name |
| Filter by Cruise Line |
| Remove $0 products |
| Human readable name |

If you want to use a table to check each of your labels, you could use scenario outlines.
Scenario Outline: Check labels
Given I am logged on as "someuser"
When I go to the homepage
Then I should see "<mylabel>"
Examples:
| mylabel |
| Filter |
| Some Other Label |
| Another Label |
The drawback is that scenario outlines are templates, where the scenario outline is run once for each of the examples provided - for your example, you just want to know all the labels are on the page so you don't really want to make a log in and request for each label.
If i wanted to ensure a page contained all the labels it was supposed to, I would just do this (the scenario would be run just once):
Scenario: Check labels
Given I am logged on as "someuser"
When I go to the homepage
And I should see "Filter"
And I should see "Some Other Label"
And I should see "Another Label"

Related

Dual criteria data validation in Excel

Unlike the other questions posted with this topic, my criteria are not simple comparators. I want a dropdown list that includes all values in one named table excluding those values that meet another criteria. For instance a table includes employee names in one column and vacation dates in another column. I want the data validation to allow a list of employees who are not on vacation for a variable date drawn from another cell. The general method seems to be to create additional tables where the secondary criteria (in this case date) is the column header populated by items from the first list that satisfy some criteria. It seems impractical to create 365 tables named for each date and populated by rows of employees from the first table that have not requested that date off. Is there another way to accomplish this?
Sample Data:
| Employee| Vacation Dates | | work on 1/26/20 |
_____________________________ ___________________
| Bob | 1/26/20, 1/27/20| | <allow only |
| Mike | 2/20/20, 2/21/20| | Mike or Cindy> |
| Cindy | 2/20/20, 1/28/20|
Had to transpose my thinking. Rather than a table for each date, I can have a vacation table for each employee. The validation formula has to be a custom validation rather than a list, so no drop down selection list is available, but it will work. Error message also cannot discriminate which criteria is being violated -- name not on employee list versus name from employee list who is on vacation. Would be great if validation worked like conditional formatting with different rules applied in sequence.
| Employee| Bob | Mike | Cindy | | 1/26/20 |
____________________________________| ___________
| Bob |1/26/20| 2/20/20 |2/20/20| | |
| Mike |1/27/20| 2/21/20 |1/28/20| | |
| Cindy |
The validation formula for the "1/26/20" column (F in the scheme above) would be
=AND(COUNTIF($A$2:$A$4,F2)>0,COUNTIF(INDIRECT(ADDRESS(2,MATCH(F2,$B$1:$D$1,0)+1)):INDIRECT(ADDRESS(3,MATCH(G2,$B$1:$D$1,0)+1)),F1)<1)

Lotus Notes Designer - Show dialog list based on value from another field

When creating a new program in Lotus Domino Designer, I thought of trying to create a dialog list (Process) which shows different list based on value of another field (Assy).
Example:
-------------
| Assy |
-------------
| Frame |
| Armature |
-------------
If Assy = Frame
----------------
| Process |
----------------
| Frame Insert |
| Adhesive |
| Vacuum |
| Magnetize |
----------------
If Assy = Armature
----------------------
| Process |
----------------------
| Commutator Insert |
| Winding |
----------------------
For the Assy field I tried using this formula:
#If(Assy="Frame";"Frame Insert":"Adhesive":
"Vacuum":"Magnetize & Appearance";Assy="Armature";
"Commutator Insert":"Winding";"")
During testing I noticed 2 things:
When I choose Frame in Assy field, the Process field will give me the correct dialog list. But when I switch Assy field to Armature and check back on Process field, the choices still remains as Frame selection. The same applies for when I choose Armature first.
When I commit to a selection in the Process field, both data in Assy and Process field disappears. Then when I try to reenter the information the Process field won't show any of my selections even after picking new Assy.
What seems to be the problem here? Do I need to make any changes in options or is my code faulty?
First of all: You need to set the setting "Refresh Choices on Document refresh" in the "Process" Field (same Tab as the Formula) and the setting "Refresh fields on keyword change" in the Assy- field.
I usually do this with another field "ProcessList", computed (or computed for display), that is above the Process- field and under the "Assy" field and contains the formula you posted above.
Then in the process field the formula is simply "ProcessList".
In normal use the "ProcessList" field is hidden.
This has the advantage that you can "debug" better by removing the hide when of the ProcessList- field and check the values directly.

Please suggest an optimised Django update Query on Bulk Data

So, I have list of dictionaries like this
dnc_info = [{'website': 'www.mdn.com', 'name':'shubham', 'company_name': 'mdn'}, {'website': 'google.com', 'name': 'ketan', 'company_name': 'google'}, {'website': 'http://microsoft.com', name:'somename', , 'company_name': 'microsoft'}, {'website': None, 'name':'somename2',, 'company_name': None}....] upto 10,000 dict
Now, I have a DataBase(PostgreSQL) table which contains the following field:
+--------------+-------------+--------------------+-------------+---------
| company_name | website | email | campaign_id | color_code | |
+--------------+-------------+--------------------+-------------+------------+--+
| google | google.com | shubham#google.com | 50 | #FFFFFF | |
| mdn | www.mdn.com | some#mdn.com | 50 | #FFFFFF | |
+--------------+-------------+--------------------+-------------+---------
up to 20,000 rows
Now what I want is to be able to update the color code field the above table from dnc_info on basis following conditions
Condition 1: Table's company name should match with dnc_info company name ignoring case sensitivity
Condition 2: Only website's domain from table should match with dnc_info website domain ignoring case senstivity
Condition 3: Table's email domain should match with dnc_info website's domain also ignoring case sensitivity.
Condition 4: Table's email should match dnc_info email also ignoring case sensitivity.
I'm able to create separate lists for every object key from dnc_info like this:
website = ['mdn.com', 'google.com', 'microsoft.com']
email = ['shubham#mdn.com', 'someone#google.com']
Please suggest an optimised model query based on the above conditions that will update the column color_code in the table.
Instead of using ORM, I had used raw_query() and it worked for me.

Nested filtering in Excel 2013 pivots

I have following table configuration in my Excel sheet (let's say that it's some kind of shop inventory):
Product | Type | Producer | Cost per unit
Apple | fruit | fruitCo | 5,00
Apple | fruit | bananaCo | 6,00
Banana | fruit | bananaCo | 4,00
T-shirt | clothes | clothsCo | 60,00
Etc.
And I've created a PivotTable from following data, that groups it by:
Filters: Producer, Type
Columns: Product
Rows: <empty>
Values: Sum of Cost
I've got two filters, Producer and Type. When I select a Producer from list (f.e bananaCo), the second filter shows me every kind of Type, even those that are not present in the already selected Producer filtering. Is there any way to make this filtering nested, so when I choose a Producer, only the types of product distributed by the selected producer appear in the Type filter list?
Not sure if this is the problem of not but try clicking on the Product field in the pivot and clicking the field settings button from the ribbon (under Options, Active Field) then Layout & Print in the window that appears.
Make sure Show items with no data is deselected.

XPage - fileDownload column order

Standard column order of a fileDownload list is | Type | Size | Name | ... |
How to change the order to | Name | Size |  Type | ... | ?
You can't change the fileDownload column order with out of the box properties.
You could
reorder columns of rendered HTML <table> with client side JavaScript or
create your own download table with a repeat control for example.
But, I am not sure if that's worth the effort...

Resources