aerokube / moon

Browser automation solution for Kubernetes and Openshift supporting Selenium, Playwright, Puppeteer and Cypress
http://aerokube.com/moon/latest
Apache License 2.0
224 stars 19 forks source link

Unable to record test execution video and upload on S3 for moon2. #431

Closed nehagoel2712 closed 1 month ago

nehagoel2712 commented 2 months ago

In our automation solution we are using Selenium4, C#, specflow, moon. And moon capabilities are like this:

_moonOptions = new Dictionary<string, object>
{
    { "enableVNC", true },
    { "name", testName },
    { "enableVideo", true },
    {"videoRetentionPeriod","24h" }
};

ChromeOptions copt = new ChromeOptions();
copt.AddAdditionalOption("moon:options", _moonOptions);
new RemoteWebDriver(new Uri(_remoteServerUri), copt.ToCapabilities(), TimeSpan.FromSeconds(Settings.Timeout));

we referred this to setup our storage and executed following commands:

helm upgrade --install --set=configs.default.storage.accessKey="<Testkey>" -n moon moon aerokube/moon2
helm upgrade --install --set=configs.default.storage.secretKey="<TestSecret>" -n moon moon aerokube/moon2
helm upgrade --install --set=configs.default.storage.endpoint="<storageEndpointfor S3>" -n moon moon aerokube/moon2
helm upgrade --install --set=configs.default.storage.bucket="<Test bucket name>" -n moon moon aerokube/moon2
helm upgrade --install --set=configs.default.storage.filename="PocVideo" -n moon moon aerokube/moon2

After all this setup, when the test was executed, the video didn't record and was not uploaded to S3.

aandryashin commented 2 months ago

Please chech that values was applied, you can simple edit your config with:

kubectl edit config default -n moon

пт, 13 сент. 2024 г., 19:00 nehagoel2712 @.***>:

In our automation solution we are using Selenium4, C#, specflow, moon. And moon capabilities are like this:

_moonOptions = new Dictionary<string, object> { { "enableVNC", true }, { "name", testName }, { "enableVideo", true }, {"videoRetentionPeriod","24h" } };

ChromeOptions copt = new ChromeOptions(); copt.AddAdditionalOption("moon:options", _moonOptions); new RemoteWebDriver(new Uri(_remoteServerUri), copt.ToCapabilities(), TimeSpan.FromSeconds(Settings.Timeout));

we referred this https://aerokube.com/moon/latest/#video-recording to setup our storage and executed following commands:

helm upgrade --install --set=configs.default.storage.accessKey="" -n moon moon aerokube/moon2 helm upgrade --install --set=configs.default.storage.secretKey="" -n moon moon aerokube/moon2 helm upgrade --install --set=configs.default.storage.endpoint="" -n moon moon aerokube/moon2 helm upgrade --install --set=configs.default.storage.bucket="" -n moon moon aerokube/moon2 helm upgrade --install --set=configs.default.storage.filename="PocVideo" -n moon moon aerokube/moon2

After all this setup, when the test was executed, the video didn't record and was not uploaded to S3.

— Reply to this email directly, view it on GitHub https://github.com/aerokube/moon/issues/431, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKY23IJRZAARLJZ6GJUJE3ZWMD2TAVCNFSM6AAAAABOFU6XFGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGUZDKMJWGU2DAMQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

nehagoel2712 commented 2 months ago

The editing config worked, and I am now able to upload videos on the s3 bucket.

But it seems that upload takes place in all cases (test case either pass or fail). Is there any way to capture/upload video to S3 only when test case fails?

vania-pooh commented 1 month ago

@nehagoel2712 Moon does not know about tests and certainly whether test case passed or failed. Our recommendation is to enable video recording only when rerunning failed test cases.