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

${TEST_INDEX} is initialized to 'null' for video recording path pattern #3455

Closed
AlexSkorkin opened this issue Feb 14, 2019 · 2 comments
Closed
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 14, 2019

What is your Test Scenario?

Running a simple test with a video recording feature enabled.

What is the Current behavior?

The 'null' folder name is created for the ${TEST_INDEX} variable in video recordings path pattern.

What is the Expected behavior?

The correct folder is created for video path pattern ${TEST_INDEX} (no 'null' folder).

What is your web application and your TestCafe test code?

Your website URL (or attach your complete example):

Your complete test code (or attach your test files):
 import { Selector, ClientFunction } from 'testcafe';

fixture("Simple test")
        .page("https://devexpress.github.io/testcafe/example");

test('Zero Test', async t => {
	console.log(await t.eval(() => ({ w: window.outerWidth, h: window.outerHeight})))
	await t.expect(false).ok('this assertion will fail');
});
		

test('First Test', async t => {
    await t.setTestSpeed(1);
	
	debugger;
	
	console.log('testing console log');
	
    await t.typeText('#developer-name', 'Alex')
		.click('#submit-button');
		
		const { error } = await t.getBrowserConsoleMessages();

    await t.expect(error).eql([]);
});

test('Second test', async t => {
	
	console.log('testing console log from the second test');
	
    await t.setTestSpeed(0.5);
});
Your complete config file:
{
    "browsers": ["chrome", "firefox:headless"],
    "src": ["test.js"],
    "screenshotPath": "./screens",
    "screenshotPathPattern": "${DATE}_${TIME}/test-${TEST_INDEX}/${USERAGENT}/${FILE_INDEX}.png",
    "takeScreenshotsOnFails": true,
    "videoPath": "reports/screen-captures",
    "videoOptions": {
        "singleFile": true,
        "failedOnly": true,
        "pathPattern": "${TEST_INDEX}/${USERAGENT}/${FILE_INDEX}.mp4"
    },
    "videoEncodingOptions": {
        "r": 20,
        "aspect": "4:3"
    },
    "stopOnFirstFail": false,
    "skipJsErrors": true,
    "skipUncaughtErrors": true,
    "concurrency": 1,
    "selectorTimeout": 3000,
    "assertionTimeout": 1000,
    "pageLoadTimeout": 1000,
    "speed": 1
}
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

 Simple test
{ w: 1366, h: 768 }
testing console log from the second test
testing console log from the second test
{ w: 1051, h: 806 }
testing console log
testing console log
 × Zero Test (screenshots: c:\Temp\!TestCafe\screens\2019-02-14_20-24-52\test-1)

   1) AssertionError: this assertion will fail: expected false to be truthy

      Browser: Chrome 72.0.3626 / Windows 10.0.0
      Screenshot: c:\Temp\!TestCafe\screens\2019-02-14_20-24-52\test-1\Chrome_72.0.3626_Windows_10.0.0\errors\1.png

          3 |fixture("Simple test")
          4 |        .page("https://devexpress.github.io/testcafe/example");
          5 |
          6 |test('Zero Test', async t => {
          7 |    console.log(await t.eval(() => ({ w: window.outerWidth, h: window.outerHeight})))
       >  8 |   await t.expect(false).ok('this assertion will fail');
          9 |});
         10 |
         11 |
         12 |test('First Test', async t => {
         13 |    await t.setTestSpeed(1);

         at ok (c:\Temp\!TestCafe\test.js:8:24)


   2) AssertionError: this assertion will fail: expected false to be truthy

      Browser: Firefox 65.0.0 / Windows 10.0.0
      Screenshot: c:\Temp\!TestCafe\screens\2019-02-14_20-24-52\test-1\Firefox_65.0.0_Windows_10.0.0\errors\1.png

          3 |fixture("Simple test")
          4 |        .page("https://devexpress.github.io/testcafe/example");
          5 |
          6 |test('Zero Test', async t => {
          7 |    console.log(await t.eval(() => ({ w: window.outerWidth, h: window.outerHeight})))
       >  8 |   await t.expect(false).ok('this assertion will fail');
          9 |});
         10 |
         11 |
         12 |test('First Test', async t => {
         13 |    await t.setTestSpeed(1);

         at ok (c:\Temp\!TestCafe\test.js:8:24)


 √ First Test
 √ Second test


 1/3 failed (14s)

Steps to Reproduce:

Run testcafe with the specified config.

Your Environment details:

  • testcafe version: 1.0.1-rc.1
  • command-line arguments: testcafe
  • browser name and version: see config
  • platform and version: Win 10
@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 14, 2019
@AndreyBelym
Copy link
Contributor

It happens only if you specify singleFile: true (because there is no associated test for the video).

@AndreyBelym AndreyBelym added this to the Sprint #28 milestone Feb 15, 2019
@AlexSkorkin AlexSkorkin changed the title $TEST_INDEX is initialized to 'null' when a video folder if created according pathPattern ${TEST_INDEX} is initialized to 'null' for video recording path pattern Feb 18, 2019
@miherlosev miherlosev self-assigned this Feb 20, 2019
@lock
Copy link

lock bot commented Mar 27, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests. For TestCafe API, usage and configuration inquiries, we recommend asking them on StackOverflow.

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

* initial commit

* functional test

* unit tests

* updated the test name

* fix test

* fix test

* Update warning-message.js

* Update warning template

* fixed the message and restructured the string utils
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