Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial support for TestCases #56

Merged
merged 5 commits into from
Dec 9, 2020
Merged

Add initial support for TestCases #56

merged 5 commits into from
Dec 9, 2020

Conversation

lesaltzm
Copy link
Collaborator

@lesaltzm lesaltzm commented Dec 8, 2020

Fix #52

This is early support. I think a mixture of server and tool changes can improve the experience by cleaning up some of these name/displayname/guid/json issues.

Example:


  'a050de8b-caa1-4092-9de2-8bad55f6aa8a' As TestSuite:
    DisplayName: ="Suite"
    Description: =""

    '06c8b692-98f2-49b9-a79d-424d968505c4' As TestCase:
      DisplayName: ="Case"
      Description: =""
      TestStepsMetadata: |-
        ="[{""Description"":""Select 'Button1'"",""Rule"":""Step1"",""ScreenId"":""3""},{""Description"":""Select 'Button1'"",""Rule"":""Step2"",""ScreenId"":""3""},{""Description"":""Select 'Button1'"",""Rule"":""Step3"",""ScreenId"":""3""},{""Description"":""Select 'Label1'"",""Rule"":""Step4"",""ScreenId"":""3""},{""Description"":""Select 'Button1'"",""Rule"":""Step5"",""ScreenId"":""3""},{""Description"":""Select 'Button1'"",""Rule"":""Step6"",""ScreenId"":""3""},{""Description"":""Select 'Label1'"",""Rule"":""Step7"",""ScreenId"":""3""}]"
      Step1: =Select('Button1')
      Step2: =Select('Button1')
      Step3: =Select('Button1')
      Step4: =Assert('Label1'.Text = "3", "Value is 3")
      Step5: =Select('Button1')
      Step6: =Select('Button1')
      Step7: =Assert('Label1'.Text= "5", "Value is 5"   /* comment here */)

    'a46b12b7-dd69-41d0-8711-55e982a93a6f' As TestCase:
      DisplayName: ="Case (1)"
      Description: =""
      TestStepsMetadata: |-
        ="[{""Description"":""Select 'Button1'"",""Rule"":""Step1"",""ScreenId"":""3""},{""Description"":""Select 'Button1'"",""Rule"":""Step2"",""ScreenId"":""3""},{""Description"":""Select 'Button1'"",""Rule"":""Step3"",""ScreenId"":""3""},{""Description"":""Select 'Label1'"",""Rule"":""Step4"",""ScreenId"":""3""},{""Description"":""Select 'Button1'"",""Rule"":""Step5"",""ScreenId"":""3""},{""Description"":""Select 'Button1'"",""Rule"":""Step6"",""ScreenId"":""3""},{""Description"":""Select 'Label1'"",""Rule"":""Step7"",""ScreenId"":""3""}]"
      Step1: =Select('Button1')
      Step2: =Select('Button1')
      Step3: =Select('Button1')
      Step4: =Assert('Label1'.Text = "3", "Value is 3")
      Step5: =Select('Button1')
      Step6: =Select('Button1')
      Step7: =Assert('Label1'.Text= "6", "Value is 5"   /* wrong? */)

@lesaltzm
Copy link
Collaborator Author

lesaltzm commented Dec 9, 2020

Example is now out of date, see file added to SrcBaselines/

@carlosfigueira
Copy link

In a scenario where we have one test case only with 3 steps, the TestCase template will have 3 behavior properties (Step1, Step2, Step3). If while editing the test offline we add 2 more steps, we need to update the TestCase template to add the additional properties (Step4, Step5).

@lesaltzm
Copy link
Collaborator Author

lesaltzm commented Dec 9, 2020

In a scenario where we have one test case only with 3 steps, the TestCase template will have 3 behavior properties (Step1, Step2, Step3). If while editing the test offline we add 2 more steps, we need to update the TestCase template to add the additional properties (Step4, Step5).

Looks like studio tries to handle it in TestManager, but I think it can be improved slightly. The GetMaxTestStepCount method relies on the # of behavior properties, but we're moving away from serializing the property kind since the template should contain that information. I'll update it to rely on the # of properties named Step[N]
image

Copy link

@carlosfigueira carlosfigueira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good; let me know if you need help testing this E2E (i.e., actually running the tests)

@lesaltzm lesaltzm merged commit 50b4128 into master Dec 9, 2020
@lesaltzm lesaltzm deleted the lesaltzm/testsupport branch December 9, 2020 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for Test Suites and Test Cases
3 participants