Requirement:- We are displaying timezone of the current date. Not the date what we received. It will fail all test case once the tz changes to PST We need to display the corresponding time zone of the date not the current timezone of the system for all dates Eg, Daylight Saving Time (United States) 2016 began at 2:00 AM on Sunday, March 13 and ends at 2:00 AM on Sunday, November 6 03/13/2016 01:59:59 - PST 03/13/2016 02:00:00 - PDT 04/21/2016 00:00:00 - PDT 11/06/2016 01:59:59 - PDT 11/06/2016 02:00:00 - PST
Current solution :-
Currently we take Date/Time value from Database and add PDT offset to match the value in UI:
For example: db_hash["STATUS_STATE_UPDATED_DATE"] = db_hash["STATUS_STATE_UPDATED_DATE"] + Time.zone_offset("PDT")
This is done in all step defs where we are verifying UI data with database.
Also we are appending string "PDT" to database value to match the date/time displayed in UI. db_hash["STATUS_STATE_UPDATED_DATE"] = db_hash["STATUS_STATE_UPDATED_DATE"].gsub("-","/").gsub("+0000","PDT").strip
We will have to fix this in all the step defs as per the new requirement.
Aucun commentaire:
Enregistrer un commentaire