opentap / OpenTap.Python

Python integration for OpenTAP
Apache License 2.0
22 stars 7 forks source link

Verify new project functionality #122

Open rmadsen-ks opened 1 year ago

rmadsen-ks commented 1 year ago

Make a new new project and verify that it works.

Prerequisites: Have Keysight Test Automation and Python v3.11 (from python.org) installed.

  1. Open CMD
  2. Go to your OpenTAP installation
  3. install Python package (The RC currently being tested)
  4. run tap python new-project --project-name MyProject --directory %USERPROFILE%\Desktop\PythonTest
  5. cd %USERPROFILE%\Desktop\PythonTest
  6. uncomment <!-- <OpenTapPackageReference Include="Editor"/> --> from MyProject.Api/MyProject.Api.csproj
  7. dotnet build
  8. Start bin\Editor
  9. Add step MyProject \ Test Step Example
  10. Run the test plan.
  11. Verify: The test plan ran to completion without error.
  12. Close the Editor application
  13. Open TestStepExample.py
  14. Modify the code:

    class TestStepExample (TestStep):
    Number = property(Int32, 1000)
    Instrument = property(TestInstrument, None)
    def __init__(self):
        super(TestStepExample, self).__init__()
    
    def Run(self):
        self.log.Debug("Number: {0}", Int32(self.Number))
        self.log.Debug("Measurement: {0}", self.Instrument.DoMeasurement())
  15. Start Editor again
  16. Add a TestInstrument instrument
  17. Add the instrument to the step in the plan.
  18. Run the test plan again.
  19. Verify: Debug log message similar to: 09:56:25.531 TestStep Measurement: -0.842833355909102