from airtest.cli.runner import AirtestCase, run_script
from airtest.cli.parser import runner_parser


class CustomAirtestCase(AirtestCase):
    def setUp(self):
        if self.args.job_id:
            self.scope['job_id']=self.args.job_id
        if self.args.job_path:
            self.scope['job_path']=self.args.job_path
        if self.args.package_name:
            self.scope['package_name']=self.args.package_name

if __name__ == '__main__':
    ap = runner_parser()
    ap.add_argument(
        "--job_id", help="job id")
    ap.add_argument(
        "--job_path", help="job path")
    ap.add_argument(
        "--package_name", help="app installation package name")
    args = ap.parse_args()
    run_script(args, CustomAirtestCase)