maciejmaciejewski / azure-pipelines-protractor

Embed Protractor HTML report in Azure Pipelines
MIT License
3 stars 3 forks source link

TypeError: expected a string #17

Open wupaz opened 4 years ago

wupaz commented 4 years ago

I'm not sur if it's a bug or a miss configuration but I'm stuck with this error ... TypeError: expected a string

My cwd path is correct, combined.json file is there. I don't understand what is wrong?!

2020-08-08T04:10:58.2608030Z ==============================================================================
2020-08-08T04:10:58.2608548Z Task         : Publish Protractor Report
2020-08-08T04:10:58.2608927Z Description  : Publish Protractor Report
2020-08-08T04:10:58.2609239Z Version      : 1.1.2
2020-08-08T04:10:58.2609551Z Author       : Maciej Maciejewski
2020-08-08T04:10:58.2610070Z Help         : https://github.com/maciejmaciejewski/azure-pipelines-protractor#usage-examples
2020-08-08T04:10:58.2610639Z ==============================================================================
2020-08-08T04:10:58.5360595Z New version has been released, please find change log at https://github.com/maciejmaciejewski/azure-pipelines-protractor/releases
2020-08-08T04:10:58.5621119Z ##[warning]TypeError: expected a string

yaml

variables:
  DropSource: 'GMaster\DevDrop'

steps:
- task: MaciejMaciejewski.azure-pipelines-protractor.PublishProtractorReport.PublishProtractorReport@1
  displayName: 'Publish Protractor Report $(System.DefaultWorkingDirectory)/$(DropSource)/Test_e2e/tstResults/'
  inputs:
    cwd: '$(System.DefaultWorkingDirectory)/$(DropSource)/Test_e2e/tstResults/'
  continueOnError: true

protractor

    ...
    jasmine.getEnv().addReporter(new HtmlReporter({
      baseDirectory: 'tstResults',
      screenshotsSubfolder: 'screenshots',
      jsonsSubfolder: 'jsons',
      takeScreenShotsOnlyForFailedSpecs: false,
      docName: 'report.html',
      preserveDirectory: true
    }).getJasmine2Reporter());
maciejmaciejewski commented 4 years ago

Hi @wupaz ✋

Seems like a miss-match between windows / separator used in the variable and unix separator \ used in the cwd path. Please rerun the build with system.debug variable set to true so I will be able to help more.

wupaz commented 4 years ago

I try \ and / without any success , but I didn't use this task in build(pipeline) but in Release.

2020-08-10T20:47:12.4064769Z ##[debug]agent.TempDirectory=C:\AzurePiplinesAgent_Extension\_work\_temp
2020-08-10T20:47:12.4095236Z ##[debug]loading inputs and endpoints
2020-08-10T20:47:12.4112500Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2020-08-10T20:47:12.4152139Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2020-08-10T20:47:12.4156599Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2020-08-10T20:47:12.4159663Z ##[debug]loading INPUT_CWD
2020-08-10T20:47:12.4162772Z ##[debug]loading INPUT_TABNAME
2020-08-10T20:47:12.4169700Z ##[debug]loaded 5
2020-08-10T20:47:12.4175566Z ##[debug]Agent.ProxyUrl=undefined
2020-08-10T20:47:12.4177376Z ##[debug]Agent.CAInfo=undefined
2020-08-10T20:47:12.4178299Z ##[debug]Agent.ClientCert=undefined
2020-08-10T20:47:12.4179162Z ##[debug]Agent.SkipCertValidation=undefined
2020-08-10T20:47:12.5861352Z New version has been released, please find change log at https://github.com/maciejmaciejewski/azure-pipelines-protractor/releases
2020-08-10T20:47:12.5873155Z ##[debug]cwd=C:\AzurePiplinesAgent_Extension\_work\r4\a\GMaster\DevDrop\Test_e2e\tstResults\
2020-08-10T20:47:12.5874419Z ##[debug]C:\AzurePiplinesAgent_Extension\_work\r4\a\GMaster\DevDrop\Test_e2e\tstResults
2020-08-10T20:47:12.6032420Z ##[debug]Processed: ##vso[task.addattachment name=00000014-005c-00ec-00f7-00b2002200fe.png;type=protractor.screenshot;]C:/AzurePiplinesAgent_Extension/_work/r4/a/GMaster/DevDrop/Test_e2e/tstResults/screenshots/00000014-005c-00ec-00f7-00b2002200fe.png
....
2020-08-10T20:47:12.6137427Z ##[debug]Agent.JobName=Release
2020-08-10T20:47:12.6137973Z ##[debug]System.StageDisplayName=undefined
2020-08-10T20:47:12.6167441Z ##[warning]TypeError: expected a string
2020-08-10T20:47:12.6168967Z ##[debug]Processed: ##vso[task.issue type=warning;]TypeError: expected a string
2020-08-10T20:47:12.6169440Z ##[debug]task result: SucceededWithIssues
2020-08-10T20:47:12.6170413Z ##[debug]Processed: ##vso[task.complete result=SucceededWithIssues;]
maciejmaciejewski commented 4 years ago

hi @wupaz can you try adding new parameter tabName: test to your YAML file? I have a feeling that the default value is not taken into account.