Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporary video files are created when running tests with a configuration file and video recording is enabled #3508

Closed
AlexSkorkin opened this issue Feb 28, 2019 · 1 comment
Assignees
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: configuration storage SYSTEM: video recording An issue related to the video recording functionality. TYPE: bug The described behavior is considered as wrong (bug).
Milestone

Comments

@AlexSkorkin
Copy link
Collaborator

AlexSkorkin commented Feb 28, 2019

What is your Test Scenario?

Running tests with a config file and video recording enabled.

What is the Current behavior?

Strange temporary video files are created during the test run and no videos are located in the specified folder; e.g.:

tmp-video-5tMTQML.mp4
tmp-video-kKMhFSu.mp4
tmp-video-L4S8VK3.mp4
tmp-video-W1PDY87.mp4
tmp-video-~MQugEC.mp4

What is the Expected behavior?

No temporary files are created and videos are placed in the specified folder

What is your web application and your TestCafe test code?

Your website URL (or attach your complete example):
repro.zip

Your complete test code (or attach your test files):
 test1.js
import { ClientFunction} from 'testcafe';

fixture `Get sale amount`
    .page('https://js.devexpress.com/');

    const getSaleAmount = ClientFunction(() => {
        const elements = document.querySelector('.dx-datagrid-rowsview').querySelectorAll('td:nth-child(3),td:nth-child(7)');
        const array = [];

        for (let i = 0; i <= elements.length - 2; i+=2) {
            const customerName  = elements[i+1].textContent;
            const saleAmount = elements[i].textContent;

            if (customerName && saleAmount)
                array.push(`Customer ${customerName}: ${saleAmount}`);
        }

        return array;
    });

test('My test', async t => {
    console.log(await getSaleAmount());
});

test2.js
import { Selector} from 'testcafe';

fixture('fixture')
    .page('file:///Temp/!TestCafe/test.html');
	
	
test('Verify states', async t => {
	const elementStyle = await Selector('#targetElement').style;
	await t.expect( elementStyle.color ).eql( "rgb(0, 128, 0)", "the color must be green!");
});

test.html
<div id="targetElement" style="color:green"></div>
Your complete test report:
c:\Temp\!TestCafe>testcafe
Using locally installed version of TestCafe.
 Running tests in:
 - Chrome 72.0.3626 / Windows 10.0.0
 - Firefox 65.0.0 / Windows 10.0.0

 Get sale amount
[ 'Customer Renewable Supplies: $6,370',
  'Customer Apollo Inc: $4,530',
  'Customer Johnson & Assoc: $1,110',
  'Customer Global Services: $6,600',
  'Customer Health Plus Inc: $2,830',
  'Customer Gemini Stores: $6,770',
  'Customer Discovery Systems: $1,460' ]
[ 'Customer Renewable Supplies: $6,370',
  'Customer Apollo Inc: $4,530',
  'Customer Johnson & Assoc: $1,110',
  'Customer Global Services: $6,600',
  'Customer Health Plus Inc: $2,830',
  'Customer Gemini Stores: $6,770',
  'Customer Discovery Systems: $1,460' ]
 √ My test

 fixture
 √ Verify states


 2 passed (59s)
config file:
{
    "browsers": ["chrome", "firefox:headless"],
    "src": ["test1.js", "test2.js"],
    "screenshotPath": "./screens",
    "screenshotPathPattern": "${DATE}_${TIME}/test-${TEST_INDEX}/${USERAGENT}/${FILE_INDEX}.png",
    "takeScreenshotsOnFails": true,
    "videoPath": "reports/screen-captures",
    "videoOptions": {
        "singleFile": false,
        "failedOnly": true,
        "pathPattern": "${TEST_INDEX}/${USERAGENT}/${FILE_INDEX}.mp4"
    },
    "videoEncodingOptions": {
        "r": 20,
        "aspect": "4:3"
    },
    "stopOnFirstFail": false,
    "skipJsErrors": true,
    "skipUncaughtErrors": true,
    "concurrency": 5,
    "selectorTimeout": 3000,
    "assertionTimeout": 1000,
    "pageLoadTimeout": 1000,
    "speed": 1,
}

Steps to Reproduce:

  1. Extract the repro.zip archive
  2. Run testcafe command

Your Environment details:

  • testcafe version: 1.1.0-rc.1
  • node.js version: 10.15
  • command-line arguments: testcafe
  • browser name and version: chrome Version 72.0.3626.109 (Official Build) (64-bit)
  • platform and version: Windows 10
  • other: none
@AlexSkorkin AlexSkorkin added TYPE: bug The described behavior is considered as wrong (bug). SYSTEM: video recording An issue related to the video recording functionality. SYSTEM: configuration storage labels Feb 28, 2019
@AlexSkorkin AlexSkorkin changed the title Temporary video files are created when running tests with a configuration file and video recording enabled Temporary video files are created when running tests with a configuration file and video recording is enabled Feb 28, 2019
@AndreyBelym AndreyBelym added this to the Sprint #29 milestone Mar 1, 2019
@AlexKamaev AlexKamaev self-assigned this Mar 18, 2019
@AndreyBelym AndreyBelym modified the milestones: Sprint #29, Sprint #30 Mar 18, 2019
@lock
Copy link

lock bot commented Mar 30, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Mar 30, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 30, 2019
kirovboris pushed a commit to kirovboris/testcafe-phoenix that referenced this issue Dec 18, 2019
…vExpress#3508) (DevExpress#3577)

* wait for Temp directory is initialized for video recording (closes DevExpress#3508)

* return promise
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: configuration storage SYSTEM: video recording An issue related to the video recording functionality. TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

3 participants