moon icon indicating copy to clipboard operation
moon copied to clipboard

Uploading files in Browser using an NFS share

Open johnqa opened this issue 2 years ago • 13 comments

Hi,

I have a deployment of Selenoid in a SWARM Cluster and I am using an NFS share to keep input data for my tests . This share is mounted in browsers containers.

I want to make the same thing for Moon deployed in Kubernetes, but I couldn't find any way of doing it.

Can you helm me with this?

Thank you, John

johnqa avatar Apr 11 '22 12:04 johnqa

@johnqa Moon only support S3 as storage. Kubernetes volumes \ NFS are not supported and we don't have plans to support it in the future.

vania-pooh avatar Apr 11 '22 18:04 vania-pooh

That is too bad.

But is there a way to run a sh script immediately after the browser container is initialised and mount the share in the filesystem?

johnqa avatar May 11 '22 09:05 johnqa

@johnqa currently we don't have such feature.

vania-pooh avatar May 11 '22 13:05 vania-pooh

@johnqa Moon only support S3 as storage. Kubernetes volumes \ NFS are not supported and we don't have plans to support it in the future.

@vania-pooh how to integrate s3 as storage for file system

code-with-v avatar May 19 '22 06:05 code-with-v

@vivek-singh-thridsummit you can use third-party tools like minio.

vania-pooh avatar May 19 '22 07:05 vania-pooh

@vania-pooh what i can see is that minio provide the storage solution for recorded video but I want a shared space for my test input data. Is there any tutorial where minio work in such a manner please provide, it would be a great help

@vivek-singh-thridsummit you can use third-party tools like minio.

code-with-v avatar May 19 '22 11:05 code-with-v

@vivek-singh-thridsummit storing test input data is out of Moon scope. Moon even does not know that you are running tests in browsers. This is just an API for efficient browser automation.

vania-pooh avatar May 19 '22 15:05 vania-pooh

Ohh Got it, Is there any way to attach configmap or mount any host volume into browser pods ?

code-with-v avatar May 20 '22 07:05 code-with-v

@vivek-singh-thridsummit no, currently this is not supported. But in Selenium e.g. you can upload files to browser pod using built-in upload feature. https://aerokube.com/selenoid/latest/#_uploading_files_to_browser

vania-pooh avatar May 20 '22 09:05 vania-pooh

can we mount hostPath is Moongrid 2.x like we do for Moongrid 1.x browser.json ?

code-with-v avatar May 22 '22 07:05 code-with-v

@vivek-singh-thridsummit currently this was not ported to Moon 2.

vania-pooh avatar May 22 '22 17:05 vania-pooh

Hi This is the approach to upload a file in c# Language. This might help you.

    [TestMethod]
    public void UploadFileTests_Test()
    {
        driver.Navigate().GoToUrl("https://cgi-lib.berkeley.edu/ex/fup.html");
        IWebElement upload = TestWebDriver.FindElement(By.Name("note"));
        upload.SendKeys(@System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetCallingAssembly().Location) + "/SampleFile.xlsx");
        TestWebDriver.FindElement(By.XPath("//input[@value='Press']")).Click();
        Console.WriteLine("File Uploaded Successfully");
    }

joshianand18 avatar Sep 14 '22 14:09 joshianand18

@joshianand18 in Moon 2 we also have this: https://aerokube.com/moon/latest/#selenium-context Detailed article: https://blog.aerokube.com/selenium-moon-environment-provisioning-72402242c917

vania-pooh avatar Sep 14 '22 14:09 vania-pooh