Error in `MplusAutomation::detectMplus()`: Mplus and Mpdemo8 are either not installed or could not be found
Try installing Mplus or Mplus Demo. If Mplus or Mplus Demo are already installed, 
make sure one can be found on your PATH. The following may help

Windows 10:
 (1) In Search, search for and then select: System (Control Panel)
 (2) Click the Advanced system settings link.
 (3) Click Environment Variables ...
 (4) In the Edit System Variable (or New System Variable ) window,
 (5) specify the value of the PATH environment variable...
 (6) Close and reopen R and run:

mplusAvailable(silent=FALSE)

test_that("mplusModel R6 object can be initialized with syntax and data", {
TITLE:  this is an example of a simple linear
m <- mplusModel(syntax = syn, data = dat, inp_file = file.path(tmp, "ex3.1.inp"))
test_that("mplusModel writes input and data files", {
test_that("mplusModel reads existing output", {
m <- mplusModel(inp_file = file.path(tmp, "ex3.1.inp"), read = TRUE)
expect_equal(m$summaries$AIC, 1396.667, tolerance = 1e-3)

"mplusModel R6 object can be initialized with syntax and data"
"
TITLE:  this is an example of a simple linear
        regression for a continuous observed
        dependent variable with two covariates
DATA:   FILE IS ex3.1.dat;
VARIABLE:       NAMES ARE y1 x1 x3;
MODEL:  y1 ON x1 x3;
"
"mplusModel writes input and data files"

mplusModel R6 object can be initialized with syntax and data

Error in `detectMplus()`: Mplus and Mpdemo8 are either not installed or could not be found
Try installing Mplus or Mplus Demo. If Mplus or Mplus Demo are already installed, 
make sure one can be found on your PATH. The following may help

Windows 10:
 (1) In Search, search for and then select: System (Control Panel)
 (2) Click the Advanced system settings link.
 (3) Click Environment Variables ...
 (4) In the Edit System Variable (or New System Variable ) window,
 (5) specify the value of the PATH environment variable...
 (6) Close and reopen R and run:

mplusAvailable(silent=FALSE)