Cypress / React-Admin table sort question - material-ui

Looking for some inspiration here. I'm using react-admin, which is a material-ui based framework, with Cypress for e2e testing, and got stuck on table sorting.
There is a Cypress test within the react-admin github project to test for table sorting, but all it does is look at whether the up/down indicator appears after you click the table heading to toggle the sort. That's a UI test, not an end-to-end test, as it doesn't look at the actual data to see if the data is sorted.
In my case, when you change the sort order, an API request is made and the UI renders the new sorted data from the API.
However, although Cypress correctly checks for the content of the first row using .contains() before the sort, once the sort is done, Cypress still responds as if the first row in the table contains the same data, rather than the new data I can see on-screen. I've checked source, and the DOM is updated to the new order.
It's like there's some caching going on somewhere, and I can't figure out where.
I can't share the full code as it's complex and proprietary, but I've boiled it down to a minimal example, which is available at https://gitlab.com/notifium_public/cypress-table-sort
This uses react-admin's own demo site.
Just do:
git clone https://gitlab.com/notifium_public/cypress-table-sort.git
npm install
npm run test
then run the table_sort.js test in Cypress.
You'll see that test logs in, checks the first row, then clicks a column header and checks that first row again. The data is randomised, so the best check I could come up with is to check the new first row doesn't contain a customer with a "last seen" date in 2020.
Visually, the new entry in the top row will be 2016/2017, but the test fails, as it's still got a a reference to the original 2020 row.
Any thoughts?
Regards,
Andy

Related

Smartsheet-api, Is there any way to get manually deleted row using smartsheet api or sdk call

I am deleting row from a sheet, On a sheet I have daily job which needs to recognize the deleted records, I need a way to recognize them using smartsheet api or sdk..
Thanks in advance..
I don't believe this scenario (identifying deleted rows) is explicitly supported by the API at this time. Seems like you could still use the API to achieve your goal though, with a bit more work (code) on your part.
Your code would have to get the sheet data (i.e., all sheet rows) at a regular interval and save that data somewhere -- then each time job runs, get the sheet data again and compare that data to the data you saved the previous time the job ran (to identify any rows that had been deleted).
Edit 9/26: Added Webhooks info
Note that with the approach I've described above, any rows that had been added AND deleted during the interval between job runs would not be detected. If it's important to identify each and every time a row is deleted, a better (and much more efficient) approach would be to use Webhooks. By using webhooks, your application subscribes to notifications for a specified sheet, and then would receive a callback (HTTP POST) from Smartsheet any time the sheet changes. Your application would need to inspect the information in each callback it receives to identify 'deleted row' events (eventType = deleted and objectType = row).
A simple way to do this is to add a column with a checkmark named "delete" or something similar, then with automation you can move the row to another sheet when the flag is detected, the row will be removed from the original sheet, but you will have a record of the deleted row in a different sheet that you can read or do what ever you need to do, this will also prevent deletions by mistake and you can even restore the row back if you need to. I don't think you need much code to implement this solution.

How to delete a dynamically generated entry in selenium IDE

I want to automate a test where I add particular details which are nicely stored in table(which initially was empty), I verify those details and then I delete those details from the table. This is repeated over a period of time.
I have been able to implement this till verification, but the problem arises when I try to delete the entries from table. The test is successfully executed once, but when new details are added again, the indexes of table entries changes and hence the selenium IDE is not being able to find the entries based on locator defined earlier.
Is it possible to find the dynamically generated indexes of table and then delete those entries?

Set Filemaker Pro layout to sort on leaving record

Actually, I want to unset it.
I'm fixing up an FMP database that's been around for years. Part of it is a layout that shows a table of scheduled events. Whenever I move from one record to another, it automatically sorts on two fields: StartDate and StartTime. I don't want it to do that anymore, but I can't find it to remove it.
I don't think it's a script. There is a SORT script in the database, but removing it did not stop the auto-sort behavior.
Check the SCRIPT TRIGGERS for the fields, i think you will find in "OnObjectsave" it calls script.
right click on the field > set script triggers
It sounds like a Script Trigger may be running on the layout. To find out:
In Layout mode, navigate to LAYOUTS > LAYOUT SETUP...
and then click the SCRIPT TRIGGERS tab. Layout script
triggers can only be configured one layout at a time.
More information on script triggers can be found here: http://help.filemaker.com/app/answers/detail/a_id/7465
Is this data from a related file/table? There might a "sort" criteria be defined in the relation.
Yes, I have this nagging problem also. The solution is found in Filemaker Help, topic = Sort, item = Options for Sorting Records. See next to last item in their instruction table (FM-12).
The setting causing automatic sorting is found in the Sort definition dialog that defines sort order for your layout. Somewhere in your script you defined a sort for your layout. OR, when creating the layout, you defined a sort order for it. Whichever, you need to find and open the Sort dialog box. Unselect "Keep records in Sorted Order." Otherwise, Filemaker will re-sort automatically.
Hope this helps.

Visio 2013: How to trigger a change in databinding of all shapes

I have a nice process overview for our ordering process in Visio. I have an external data source (SQL Server), which works fine. Every record in my data source represents one ordering process. Currently all my shapes of the process are linked to the first record of the data source.
Now I want to add a dynamic behavior. What I want to achieve is this:
A user provides the order reference in a textbox (order reference is a column in the data source)
Afterwards the user clicks a button
After the button click, the process is updated and all shapes are now linked to the external data source record, that matches the provided order reference
So in short: the user should be able to select which process that needs to be visualized.
I assume that this is common functionality, but I don't see how I can deal with this requirement. I've searched already some days on this issue, but without any success.
Can you help me with this issue?
Thanks a lot!
Problem solved :-)
Some old school VBA was required. Using the DataRecordSet object did the trick. It contains a method GetDataRowIDs that you can use to query the external dataset. Once you have the record to visualize, it's just a matter of dynamically updating the shapes with the correct record. Use macro recording to see how to do this.
MSDN: http://msdn.microsoft.com/en-us/library/office/ms195694(v=office.12).aspx

When a teacher add an assignment, all the student names appear. How to do it?

I have a task to create a database to track student results in a school. I came out with a set of relationships between the tables according to the 3 forms of normalisation(I hope I got it right. If not, please enlighten me).
One feature that I want to put in the Filemaker app is that when a teacher want to enter some assignment marks, he will just need to create a new submission record and all the student names in the class will appear.
I could not think how this feature can be done in Filemaker. I can only create a new submissions record and key in a student's score, then create another new record to do the same thing for a second student.
Can someone help? I am a teacher, not a Filemaker developer so please correct me if my database tables are done wrongly.
Update:
I will like the output to be like this
Spreadsheet is not suitable because it can't be used to search/sort easily.
I have a quick sample file here. It's an old sample and it uses a different (but similar) model. Basically the idea is that: You have a calculated field (I use a repeating field) to display the data. You also have a global repeating field that serves as an editing widget. Each time you go to a record you fill this field's reps with data from related records (using a OnRecordLoad trigger). This doesn't mean the field shows the same data for all records, because its conditional formatting rules are set to hide all data; so it only shows a piece of data when you actually enter one of its repetitions. This is the data that can be edited. And finally there's a trigger that fires each time you exit the field and posts your changes to the related table (adds, updates, or deletes).
The sample isn't quite complete because if there's fewer data columns than repetitions, you'd probably want to somehow lock the remaining repetitions; this part isn't done. Otherwise it works fairly well. In FM 12, however, it tends to freeze the app; I reported this to FMI, they acknowledged it, but I don't think it has been fixed already.